Package org.dashbuilder.dataset.group

Examples of org.dashbuilder.dataset.group.ColumnGroup


            _groupSelect.setSelectedIntervalNames(values);

        } else {
            _groupSelect = new DataSetGroup();
            _groupSelect.setSelectedIntervalNames(values);
            _groupSelect.setColumnGroup(new ColumnGroup(columnId, columnId, GroupStrategy.DYNAMIC));
        }
        // Notify to those interested parties the selection event.
        if (displayerSettings.isFilterNotificationEnabled()) {
            for (DisplayerListener listener : listenerList) {
                listener.onGroupIntervalsSelected(this, _groupSelect);
View Full Code Here


        columnSelectionMap.remove(columnId);
        DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId);
        if (groupOp == null || groupOp.getColumnGroup() == null) {
            groupOp = new DataSetGroup();
            groupOp.setColumnGroup(new ColumnGroup(columnId, columnId, GroupStrategy.DYNAMIC));
        }
        // Notify to those interested parties the reset event.
        if (displayerSettings.isFilterNotificationEnabled()) {
            for (DisplayerListener listener : listenerList) {
                listener.onGroupIntervalsReset(this, Arrays.asList(groupOp));
View Full Code Here

        List<DataSetGroup> groupOpList = new ArrayList<DataSetGroup>();
        for (String columnId : columnSelectionMap.keySet()) {
            DataSetGroup groupOp = dataSetHandler.getGroupOperation(columnId);
            if (groupOp == null || groupOp.getColumnGroup() == null) {
                groupOp = new DataSetGroup();
                groupOp.setColumnGroup(new ColumnGroup(columnId, columnId, GroupStrategy.DYNAMIC));
            }
            groupOpList.add(groupOp);

        }
        columnSelectionMap.clear();
View Full Code Here

        if (index == -1) return null;
        return lookupCurrent.getOperation(index);
    }

    public boolean filter(DataSetGroup op) {
        ColumnGroup cg = op.getColumnGroup();
        if (cg == null) throw new RuntimeException("Group ops requires to specify a pivot column.");
        if (op.getSelectedIntervalNames().isEmpty()) throw new RuntimeException("Group intervals not specified");

        // Avoid duplicates
        for (DataSetGroup next : lookupCurrent.getOperationList(DataSetGroup.class)) {
View Full Code Here

        _filter(0, clone, false);
        return true;
    }

    public boolean drillDown(DataSetGroup op) {
        ColumnGroup cg = op.getColumnGroup();
        if (cg == null) throw new RuntimeException("Group ops requires to specify a pivot column.");
        if (op.getSelectedIntervalNames().isEmpty()) throw new RuntimeException("Group intervals not specified");

        // Avoid duplicates
        for (DataSetGroup next : lookupCurrent.getOperationList(DataSetGroup.class)) {
            if (op.equals(next)) {
                return false;
            }
        }
        // Get the latest group op. for the target column being selected.
        int lastSelection = lookupCurrent.getLastGroupOpIndex(0, null, true) + 1;
        int targetGroup = lookupCurrent.getLastGroupOpIndex(lastSelection, cg.getColumnId(), false);

        // If the selection does not exists just add it.
        if (targetGroup == -1) {
            DataSetGroup clone = op.cloneInstance();
            clone.getGroupFunctions().clear();
View Full Code Here

    protected Map<String,List<GroupOpFilter>> _groupOpsAdded = new HashMap<String,List<GroupOpFilter>>();
    protected Map<String,List<GroupOpFilter>> _groupOpsSelected = new HashMap<String,List<GroupOpFilter>>();

    protected void _filter(int index, DataSetGroup op, boolean drillDown) {

        ColumnGroup cgroup = op.getColumnGroup();
        String columnId = cgroup.getColumnId();
        if (!_groupOpsAdded.containsKey(columnId)) _groupOpsAdded.put(columnId, new ArrayList<GroupOpFilter>());
        List<GroupOpFilter> filterOps = _groupOpsAdded.get(columnId);

        // When adding an external filter, look first if it exists an existing filter already.
        if (!drillDown) {
View Full Code Here

    public DataSetGroupIndex getGroupIndex(ColumnGroup gc) {
        if (groupIndexes == null) return null;

        String key = getGroupKey(gc);
        for (DataSetGroupIndex groupIndex : groupIndexes) {
            ColumnGroup c = groupIndex.columnGroup;
            if (key.equals(getGroupKey(c))) {
                groupIndex.reuseHit();
                return groupIndex;
            }
        }
View Full Code Here

                if (DataSetOpType.GROUP.equals(op.getType())) {
                    if (calculations) throw new IllegalStateException("Group not permitted after a simple function calculation operation.");
                    if (sort) throw new IllegalStateException("Sort operations must be applied ALWAYS AFTER GROUP.");

                    DataSetGroup gOp = (DataSetGroup) op;
                    ColumnGroup columnGroup = gOp.getColumnGroup();
                    if (columnGroup == null) {
                        // No real group requested. Only function calculations on the data set.
                        calculations = true;
                        context.lastOperation = op;
                    } else {
View Full Code Here

        }

        // GROUP OPERATION

        protected void checkGroupOp(DataSet dataSet, DataSetGroup op) {
            ColumnGroup cg = op.getColumnGroup();
            if (cg != null) {
                String id = cg.getSourceId();
                if (dataSet.getColumnById(id) == null) {
                    throw new IllegalArgumentException("Group column specified not found in the data set: " + id);
                }
            }
        }
View Full Code Here

        protected boolean group(DataSetGroup op, InternalContext context) {
            checkGroupOp(context.dataSet, op);

            // Group by the specified column (if any).
            ColumnGroup columnGroup = op.getColumnGroup();

            // No real group requested. Only function calculations on the data set.
            if (columnGroup == null) return true;

            // Nested groups are only supported on the presence of a parent group interval selection operation.
View Full Code Here

TOP

Related Classes of org.dashbuilder.dataset.group.ColumnGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.