本文整理汇总了Java中org.olap4j.Axis类的典型用法代码示例。如果您正苦于以下问题:Java Axis类的具体用法?Java Axis怎么用?Java Axis使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Axis类属于org.olap4j包,在下文中一共展示了Axis类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setLabelAsEmptyNoHierarchies
import org.olap4j.Axis; //导入依赖的package包/类
/**
* This method will set the header component to have the default message if
* there are no hierarchies in this axis.
*/
private void setLabelAsEmptyNoHierarchies() {
setLayout(new BorderLayout());
JPanel panel = new JPanel(new MigLayout("flowy, align 50% 50%, ins 20", "align center", ""));
panel.setBackground(Color.WHITE);
String axisString = null;
if (axis == Axis.COLUMNS) {
axisString = "Columns Axis:";
} else if (axis == Axis.ROWS) {
axisString = "Rows Axis:";
}
JLabel axisLabel = new JLabel(axisString);
axisLabel.setFont(axisLabel.getFont().deriveFont(Font.BOLD));
panel.add(axisLabel, SwingConstants.CENTER);
JLabel label = new JLabel("Drag Dimensions, Hierarchies,", SwingConstants.CENTER);
panel.add(label);
label = new JLabel("Measures, and Members here", SwingConstants.CENTER);
panel.add(label);
addGreyedButtonsToPanel(panel);
panel.setBorder(defaultBorder);
add(panel, BorderLayout.CENTER);
}
开发者ID:SQLPower,项目名称:wabit,代码行数:28,代码来源:CellSetTableHeaderComponent.java
示例2: calcDropInsertIndex
import org.olap4j.Axis; //导入依赖的package包/类
private int calcDropInsertIndex(Point p) {
if (!(getComponentAt(p) instanceof HierarchyComponent)) return 0;
HierarchyComponent hc = (HierarchyComponent) getComponentAt(p);
int indexOfHC = Arrays.asList(getComponents()).indexOf(hc);
if (indexOfHC == -1) {
return 0;
} else {
Point hcRelativePos = SwingUtilities.convertPoint(
CellSetTableHeaderComponent.this, new Point(p), hc);
boolean beforeMiddle;
if (axis == Axis.ROWS) {
beforeMiddle = hcRelativePos.x < (hc.getWidth() / 2);
} else if (axis == Axis.COLUMNS) {
beforeMiddle = hcRelativePos.y < (hc.getHeight() / 2);
} else {
throw new IllegalStateException(
"I only know how to deal with ROWS and COLUMNS," +
" but this component is for " + axis);
}
if (beforeMiddle) {
return indexOfHC;
} else {
return indexOfHC + 1;
}
}
}
开发者ID:SQLPower,项目名称:wabit,代码行数:27,代码来源:CellSetTableHeaderComponent.java
示例3: mousePressed
import org.olap4j.Axis; //导入依赖的package包/类
public void mousePressed(MouseEvent e) {
boolean showedPopup = maybeShowPopup(e, selectedMember);
if (!showedPopup && selectedMember != null && e.getButton() == MouseEvent.BUTTON1) {
try {
if (selectedMember instanceof Measure) {
Axis sortAxis = axis.getAxisOrdinal() == Axis.ROWS ? Axis.COLUMNS : Axis.ROWS;
SortOrder order = query.getSortOrder(sortAxis);
SortOrder newOrder;
if (order == SortOrder.ASC) {
newOrder = SortOrder.DESC;
} else {
newOrder = SortOrder.ASC;
}
query.sortBy(sortAxis, newOrder, (Measure) selectedMember);
} else {
query.toggleMember(selectedMember);
}
} catch (Exception ex) {
throw new RuntimeException("Database error while trying to execute the OLAP query", ex);
}
}
}
开发者ID:SQLPower,项目名称:wabit,代码行数:23,代码来源:CellSetTableHeaderComponent.java
示例4: getMemberAtPoint
import org.olap4j.Axis; //导入依赖的package包/类
public Member getMemberAtPoint(Point p) {
if (axis == null) return null;
if (axis.getAxisOrdinal() == Axis.ROWS) {
// This is a special-case optimization for members in the row axis
int rowNum = (int) (p.y / rowHeight);
if (rowNum >= getLayoutItems().size()) return null;
if (rowNum < 0) return null;
return getLayoutItems().get(rowNum).member;
} else {
for (LayoutItem item: getLayoutItems()) {
if (item.bounds.contains(p)) {
return item.member;
}
}
return null;
}
}
开发者ID:SQLPower,项目名称:wabit,代码行数:18,代码来源:CellSetTableHeaderComponent.java
示例5: saveOlapAxis
import org.olap4j.Axis; //导入依赖的package包/类
private void saveOlapAxis(WabitOlapAxis axis) {
xml.print(out, "<olap4j-axis");
printCommonAttributes(axis);
printAttribute("ordinal", axis.getOrdinal().axisOrdinal());
if (axis.getOrdinal() == Axis.ROWS) {
printAttribute("non-empty", axis.isNonEmpty());
}
if (axis.getSortOrder() != null) {
printAttribute("sort-order", axis.getSortOrder());
printAttribute("sort-evaluation-literal", axis.getSortEvaluationLiteral());
}
xml.niprintln(out, ">");
xml.indent++;
for (WabitOlapDimension dimension : axis.getDimensions()) {
saveOlapDimension(dimension);
}
xml.indent--;
xml.println(out, "</olap4j-axis>");
}
开发者ID:SQLPower,项目名称:wabit,代码行数:23,代码来源:WorkspaceXMLDAO.java
示例6: removeDimension
import org.olap4j.Axis; //导入依赖的package包/类
/**
* Removes the given {@link Dimension} from the given {@link Axis} in the
* query
*
* @param dimension
* The {@link Dimension} to remove
* @param axis
* The {@link Axis} to remove the {@link Dimension} from
* @throws QueryInitializationException
*/
public synchronized void removeDimension(Dimension dimension, Axis axis) throws QueryInitializationException {
QueryAxis qa = getMDXQuery().getAxis(axis);
QueryDimension qd = getMDXQuery().getDimension(dimension.getName());
if (qa.equals(qd.getAxis())) {
qd.clearInclusions();
qd.clearExclusions();
qa.removeDimension(qd);
if (axis != Axis.FILTER) {
hierarchiesInUse.remove(qd);
} else {
slicerMember = null;
}
}
updateAttributes();
}
开发者ID:SQLPower,项目名称:wabit,代码行数:28,代码来源:OlapQuery.java
示例7: setMdxQuery
import org.olap4j.Axis; //导入依赖的package包/类
/**
* Replaces the current olap4j query with the given one. Preserves the
* current non-empty rows setting.
*
* @param mdxQuery
* The new query. Must not be null.
* @throws OlapException
*/
private synchronized void setMdxQuery(Query mdxQuery) {
if (mdxQuery == null) throw new NullPointerException();
this.mdxQuery = mdxQuery;
mdxQuery.getAxis(Axis.ROWS).setNonEmpty(nonEmpty);
this.currentCube = mdxQuery.getCube();
clearAxes();
for (QueryAxis axis : mdxQuery.getAxes().values()) {
if (axis.getLocation() != null) {
addAxis(new WabitOlapAxis(axis));
}
}
if (isMagicEnabled()){
this.setModifiedOlapQuery(null);
}
}
开发者ID:SQLPower,项目名称:wabit,代码行数:25,代码来源:OlapQuery.java
示例8: addDimensionToAxis
import org.olap4j.Axis; //导入依赖的package包/类
/**
* Adds a dimension to an axis at the given ordinal. This is package private for
* use by other parts of the query.
* @param ordinal The position in the axis to add the dimension at.
* @param qa The axis to add the dimension to.
* @param qd The dimension to add to the axis.
*/
void addDimensionToAxis(int ordinal, Axis axis, QueryDimension qd) throws QueryInitializationException {
QueryAxis qa = getMDXQuery().getAxis(axis);
if (!qa.equals(qd.getAxis())) {
qd.clearInclusions();
qa.addDimension(ordinal, qd);
if (qa.getLocation() != Axis.FILTER) {
hierarchiesInUse.put(qd, qd.getDimension().getDefaultHierarchy());
}
} else {
int index = qa.getDimensions().indexOf(qd);
if (index >= 0) {
qa.getDimensions().remove(index);
if (index < ordinal) {
ordinal--;
}
qa.getDimensions().add(ordinal, qd);
if (qa.getLocation() != Axis.FILTER) {
hierarchiesInUse.put(qd, qd.getDimension().getDefaultHierarchy());
}
}
}
}
开发者ID:SQLPower,项目名称:wabit,代码行数:30,代码来源:OlapQuery.java
示例9: parseAxes
import org.olap4j.Axis; //导入依赖的package包/类
protected void parseAxes(CellSet result)
{
// Cycle over AxisInfo-Elements
Iterator<CellSetAxis> itAxis = result.getAxes().iterator();
log.debug("# axes: " + result.getAxes().size());
while (itAxis.hasNext())
{
CellSetAxis itAxisElement = itAxis.next();
Axis axis = itAxisElement.getAxisMetaData().getAxisOrdinal();
if (axis.axisOrdinal() == Axis.FILTER.axisOrdinal())
{
if (log.isDebugEnabled())
{
log.debug("skipping filter axis: " + axis.name() + ", ordinal: " + axis.axisOrdinal());
}
continue;
}
JRXmlaResultAxis xmlaAxis = new JRXmlaResultAxis(axis.name());
xmlaResult.addAxis(xmlaAxis);
if (log.isDebugEnabled())
{
log.debug("adding axis: " + axis.name() + ", ordinal: " + axis.axisOrdinal());
}
handleHierInfo(xmlaAxis, itAxisElement.getAxisMetaData());
ListIterator<Position> positionsIt = itAxisElement.iterator();
while (positionsIt.hasNext())
{
Position p = positionsIt.next();
if (log.isDebugEnabled())
{
log.debug("adding pos : " + p.getOrdinal() + ", with member size: " + p.getMembers().size());
}
handlePosition(xmlaAxis, itAxisElement, p);
}
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:41,代码来源:Olap4jXmlaQueryExecuter.java
示例10: getPreferredSize
import org.olap4j.Axis; //导入依赖的package包/类
@Override
public Dimension getPreferredSize() {
createLayout();
Dimension ps = new Dimension();
if (axis != null && axis.getAxisOrdinal() == Axis.ROWS) {
ps.width = cornerComponent.preferredSizes.get(hierarchyOrdinal).width;
}
for (LayoutItem li : getLayoutItems()) {
ps.width = (int) Math.max(li.bounds.getX() + li.bounds.getWidth(), ps.width);
ps.height = (int) Math.max(li.bounds.getY() + li.bounds.getHeight(), ps.height);
}
return ps;
}
开发者ID:SQLPower,项目名称:wabit,代码行数:14,代码来源:CellSetTableHeaderComponent.java
示例11: convertToComplexType
import org.olap4j.Axis; //导入依赖的package包/类
public Axis convertToComplexType(String convertFrom)
throws ConversionException {
if (convertFrom == null) return null;
Standard axis = Axis.Standard.valueOf(convertFrom);
return axis;
}
开发者ID:SQLPower,项目名称:wabit,代码行数:9,代码来源:Olap4JAxisConverter.java
示例12: convertToSimpleType
import org.olap4j.Axis; //导入依赖的package包/类
public String convertToSimpleType(Axis convertFrom,
Object... additionalInfo) {
//Some Axis are null as they are depreciated.
if (convertFrom == null) return null;
return convertFrom.name();
}
开发者ID:SQLPower,项目名称:wabit,代码行数:9,代码来源:Olap4JAxisConverter.java
示例13: getOrdinal
import org.olap4j.Axis; //导入依赖的package包/类
public Axis getOrdinal() {
logger.debug("Query Axis is " + queryAxis);
if (initialized) {
return queryAxis.getLocation();
} else {
return ordinal;
}
}
开发者ID:SQLPower,项目名称:wabit,代码行数:9,代码来源:WabitOlapAxis.java
示例14: getHierarchies
import org.olap4j.Axis; //导入依赖的package包/类
private synchronized List<Hierarchy> getHierarchies(Axis axis) throws QueryInitializationException {
if (getMDXQuery() == null) return Collections.emptyList();
QueryAxis qa = getMDXQuery().getAxis(axis);
List<Hierarchy> selectedHierarchies = new ArrayList<Hierarchy>();
for (QueryDimension qd : qa.getDimensions()) {
Hierarchy h = hierarchiesInUse.get(qd);
assert h != null : qd + " not in " + hierarchiesInUse;
selectedHierarchies.add(h);
}
return selectedHierarchies;
}
开发者ID:SQLPower,项目名称:wabit,代码行数:12,代码来源:OlapQuery.java
示例15: sortBy
import org.olap4j.Axis; //导入依赖的package包/类
/**
* Sorts the OLAP results on the given {@link Axis} by the given
* {@link Measure} in the given {@link SortOrder}
*/
public synchronized void sortBy(Axis axis, SortOrder order, Measure measure) throws QueryInitializationException {
getMDXQuery().getAxis(axis).sort(order, measure);
if (isMagicEnabled()){
this.setModifiedOlapQuery(null);
}
fireStructureChanged();
}
开发者ID:SQLPower,项目名称:wabit,代码行数:12,代码来源:OlapQuery.java
示例16: clearSort
import org.olap4j.Axis; //导入依赖的package包/类
/**
* Removes the sort order on the given axis
*
* @param axis
* The Axis from which to remove the sort order
* @throws QueryInitializationException
*/
public synchronized void clearSort(Axis axis) throws QueryInitializationException {
getMDXQuery().getAxis(axis).clearSort();
if (isMagicEnabled()){
this.setModifiedOlapQuery(null);
}
fireStructureChanged();
}
开发者ID:SQLPower,项目名称:wabit,代码行数:15,代码来源:OlapQuery.java
示例17: setNonEmpty
import org.olap4j.Axis; //导入依赖的package包/类
/**
* Sets the ROWS axis of this query to omit empty positions.
*
* @param nonEmpty
* True means to omit empty positions; false means to include
* them.
*/
public synchronized void setNonEmpty(boolean nonEmpty) {
boolean oldVal = this.nonEmpty;
this.nonEmpty = nonEmpty;
if (mdxQuery != null) {
mdxQuery.getAxis(Axis.ROWS).setNonEmpty(nonEmpty);
logger.debug("Query has rows non-empty? " + mdxQuery.getAxis(Axis.ROWS).isNonEmpty());
}
firePropertyChange("nonEmpty", oldVal, nonEmpty);
fireStructureChanged();
}
开发者ID:SQLPower,项目名称:wabit,代码行数:18,代码来源:OlapQuery.java
示例18: setUp
import org.olap4j.Axis; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
wabitAxis = new WabitOlapAxis(Axis.ROWS);
OlapQuery query = new OlapQuery(new StubOlapConnectionMapping());
query.addChild(wabitAxis, 0);
getWorkspace().addOlapQuery(query);
}
开发者ID:SQLPower,项目名称:wabit,代码行数:9,代码来源:WabitOlapAxisTest.java
示例19: setUp
import org.olap4j.Axis; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
wabitExclusion = new WabitOlapExclusion(Operator.MEMBER, "unique/member/name");
WabitOlapDimension wabitDimension = new WabitOlapDimension("dimension");
wabitDimension.addChild(wabitExclusion, 0);
OlapQuery query = new OlapQuery(new StubOlapConnectionMapping());
WabitOlapAxis axis = new WabitOlapAxis(Axis.ROWS);
axis.addDimension(wabitDimension);
query.addChild(axis, 0);
getWorkspace().addOlapQuery(query);
}
开发者ID:SQLPower,项目名称:wabit,代码行数:14,代码来源:WabitOlapExclusionTest.java
示例20: setUp
import org.olap4j.Axis; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
wabitDimension = new WabitOlapDimension("Dimension");
OlapQuery query = new OlapQuery(new StubOlapConnectionMapping());
WabitOlapAxis axis = new WabitOlapAxis(Axis.ROWS);
query.addAxis(axis);
axis.addDimension(wabitDimension);
getWorkspace().addOlapQuery(query);
}
开发者ID:SQLPower,项目名称:wabit,代码行数:12,代码来源:WabitOlapDimensionTest.java
注:本文中的org.olap4j.Axis类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论