Search in sources :

Example 31 with Group

use of controlP5.Group in project kie-wb-common by kiegroup.

the class Bpmn2JsonUnmarshaller method createDiagram.

private void createDiagram(Definitions def) {
    for (RootElement rootElement : def.getRootElements()) {
        if (rootElement instanceof Process) {
            Process process = (Process) rootElement;
            BpmnDiFactory factory = BpmnDiFactory.eINSTANCE;
            BPMNDiagram diagram = factory.createBPMNDiagram();
            BPMNPlane plane = factory.createBPMNPlane();
            plane.setBpmnElement(process);
            diagram.setPlane(plane);
            // first process flowNodes
            for (FlowElement flowElement : process.getFlowElements()) {
                if (flowElement instanceof FlowNode) {
                    createBpmnShapeForElement(factory, plane, flowElement);
                    if (flowElement instanceof BoundaryEvent) {
                        createDockersForBoundaryEvent((BoundaryEvent) flowElement);
                    }
                    // check if its a subprocess
                    if (flowElement instanceof SubProcess) {
                        createSubProcessDiagram(plane, flowElement, factory);
                    }
                } else if (flowElement instanceof DataObject) {
                    createBpmnShapeForElement(factory, plane, flowElement);
                } else if (flowElement instanceof SequenceFlow) {
                    createBpmnEdgeForSequenceFlow(factory, plane, (SequenceFlow) flowElement);
                }
            }
            // then process artifacts
            if (process.getArtifacts() != null) {
                List<Association> incompleteAssociations = new ArrayList<Association>();
                for (Artifact artifact : process.getArtifacts()) {
                    // if (artifact instanceof TextAnnotation || artifact instanceof Group) {
                    if (artifact instanceof Group) {
                        createBpmnShapeForElement(factory, plane, artifact);
                    }
                    if (artifact instanceof Association) {
                        Association association = (Association) artifact;
                        if (association.getSourceRef() != null && association.getTargetRef() != null) {
                            createBpmnEdgeForAssociation(factory, plane, association);
                        } else {
                            incompleteAssociations.add(association);
                        }
                    }
                }
                if (!incompleteAssociations.isEmpty()) {
                    for (Association incompleteAssociation : incompleteAssociations) {
                        process.getArtifacts().remove(incompleteAssociation);
                    }
                }
            }
            // finally process lanes
            if (process.getLaneSets() != null && process.getLaneSets().size() > 0) {
                for (LaneSet ls : process.getLaneSets()) {
                    for (Lane lane : ls.getLanes()) {
                        createBpmnShapeForElement(factory, plane, lane);
                    }
                }
            }
            def.getDiagrams().add(diagram);
        }
    }
}
Also used : AdHocSubProcess(org.eclipse.bpmn2.AdHocSubProcess) SubProcess(org.eclipse.bpmn2.SubProcess) Group(org.eclipse.bpmn2.Group) BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) SequenceFlow(org.eclipse.bpmn2.SequenceFlow) ArrayList(java.util.ArrayList) Lane(org.eclipse.bpmn2.Lane) AdHocSubProcess(org.eclipse.bpmn2.AdHocSubProcess) SubProcess(org.eclipse.bpmn2.SubProcess) Process(org.eclipse.bpmn2.Process) LaneSet(org.eclipse.bpmn2.LaneSet) BpmnDiFactory(org.eclipse.bpmn2.di.BpmnDiFactory) Artifact(org.eclipse.bpmn2.Artifact) BPMNDiagram(org.eclipse.bpmn2.di.BPMNDiagram) RootElement(org.eclipse.bpmn2.RootElement) DataObject(org.eclipse.bpmn2.DataObject) Association(org.eclipse.bpmn2.Association) DataOutputAssociation(org.eclipse.bpmn2.DataOutputAssociation) DataInputAssociation(org.eclipse.bpmn2.DataInputAssociation) FlowElement(org.eclipse.bpmn2.FlowElement) BPMNPlane(org.eclipse.bpmn2.di.BPMNPlane) FlowNode(org.eclipse.bpmn2.FlowNode)

Example 32 with Group

use of controlP5.Group in project ORCID-Source by ORCID.

the class Api2_0_rc4_LastModifiedDatesHelper method calculateLastModified.

public static void calculateLastModified(GroupsContainer groupsContainerRc4) {
    if (groupsContainerRc4.retrieveGroups() != null && !groupsContainerRc4.retrieveGroups().isEmpty()) {
        List<? extends Group> groupsRc1 = new ArrayList<>(groupsContainerRc4.retrieveGroups());
        List<org.orcid.jaxb.model.record_rc4.Group> groupsRc4 = new ArrayList<>(groupsContainerRc4.retrieveGroups());
        if (groupsRc1.get(0).getActivities() != null && !groupsRc1.get(0).getActivities().isEmpty()) {
            LastModifiedDate latest = null;
            for (Group group : groupsRc4) {
                calculateLastModified(group);
                if (group.getLastModifiedDate() != null && group.getLastModifiedDate().after(latest)) {
                    latest = group.getLastModifiedDate();
                }
            }
            groupsContainerRc4.setLastModifiedDate(latest);
        }
    }
}
Also used : Group(org.orcid.jaxb.model.record_rc4.Group) LastModifiedDate(org.orcid.jaxb.model.common_rc4.LastModifiedDate) ArrayList(java.util.ArrayList)

Example 33 with Group

use of controlP5.Group in project ORCID-Source by ORCID.

the class PublicAPISecurityManagerV2Test method setVisibility.

private void setVisibility(GroupsContainer container, Visibility... vs) {
    assertEquals(container.retrieveGroups().size(), vs.length);
    int idx = 0;
    for (Group g : container.retrieveGroups()) {
        // Every group have just one element
        assertEquals(1, g.getActivities().size());
        for (Filterable f : g.getActivities()) {
            f.setVisibility(vs[idx++]);
        }
    }
}
Also used : WorkGroup(org.orcid.jaxb.model.record.summary_v2.WorkGroup) PeerReviewGroup(org.orcid.jaxb.model.record.summary_v2.PeerReviewGroup) FundingGroup(org.orcid.jaxb.model.record.summary_v2.FundingGroup) Group(org.orcid.jaxb.model.record_v2.Group) Filterable(org.orcid.jaxb.model.common_v2.Filterable)

Example 34 with Group

use of controlP5.Group in project sirix by sirixdb.

the class AbstractSunburstGUI method style.

/**
 * Style menu.
 */
protected void style() {
    final Group ctrl = mControlP5.addGroup("menu", 15, 25, 35);
    ctrl.setColorLabel(mParent.color(255));
    ctrl.setColorBackground(mParent.color(100));
    ctrl.close();
    mParent.colorMode(PConstants.RGB, 255, 255, 255);
    final int backgroundColor = 0x99ffffff;
    int i = 0;
    for (final Slider slider : mSliders) {
        slider.setGroup(ctrl);
        slider.setId(i);
        final Label label = slider.getCaptionLabel();
        label.toUpperCase(true);
        label.setColor(mParent.color(0));
        label.setColorBackground(backgroundColor);
        final ControllerStyle style = label.getStyle();
        style.padding(4, 0, 1, 3);
        style.marginTop = -4;
        style.marginLeft = 0;
        style.marginRight = -14;
        slider.plugTo(mControl);
        i++;
    }
    i = 0;
    for (final Range range : mRanges) {
        range.setGroup(ctrl);
        range.setId(i);
        final Label label = range.getCaptionLabel();
        label.toUpperCase(true);
        label.setColor(mParent.color(0));
        label.setColorBackground(backgroundColor);
        final ControllerStyle style = label.getStyle();
        style.padding(4, 0, 1, 3);
        style.marginTop = -4;
        range.plugTo(mControl);
        i++;
    }
    i = 0;
    for (final Toggle toggle : mToggles) {
        toggle.setGroup(ctrl);
        toggle.setId(i);
        final Label label = toggle.getCaptionLabel();
        label.setColor(mParent.color(0));
        label.setColorBackground(backgroundColor);
        final ControllerStyle style = label.getStyle();
        style.padding(4, 3, 1, 3);
        style.marginTop = -19;
        style.marginLeft = 18;
        style.marginRight = 5;
        toggle.plugTo(mControl);
        i++;
    }
    mParent.colorMode(PConstants.HSB, 360, 100, 100);
    mParent.textLeading(14);
    mParent.textAlign(PConstants.LEFT, PConstants.TOP);
    mParent.cursor(PConstants.CROSS);
}
Also used : Group(controlP5.Group) ControllerStyle(controlP5.ControllerStyle) Slider(controlP5.Slider) Toggle(controlP5.Toggle) Label(controlP5.Label) Range(controlP5.Range)

Example 35 with Group

use of controlP5.Group in project sis by apache.

the class DecoderWrapper method setSearchPath.

/**
 * Defines the groups where to search for named attributes, in preference order.
 * The {@code null} group name stands for the global attributes.
 */
@Override
public void setSearchPath(final String... groupNames) {
    final Group[] groups = new Group[groupNames.length];
    int count = 0;
    for (final String name : groupNames) {
        if (name != null) {
            final Group group = file.findGroup(name);
            if (group == null) {
                // Group not found - do not increment the counter.
                continue;
            }
            groups[count] = group;
        }
        count++;
    }
    this.groups = ArraysExt.resize(groups, count);
}
Also used : Group(ucar.nc2.Group) FeatureDatasetPoint(ucar.nc2.ft.FeatureDatasetPoint)

Aggregations

ArrayList (java.util.ArrayList)9 Group (org.gluu.oxtrust.model.scim2.Group)8 Group (org.openstack4j.model.identity.v3.Group)8 Group (ucar.nc2.Group)8 GluuGroup (org.gluu.oxtrust.model.GluuGroup)7 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)7 Group (com.google.monitoring.v3.Group)5 EntryPersistenceException (org.gluu.site.ldap.persistence.exception.EntryPersistenceException)5 Test (org.junit.Test)5 GroupName (com.google.monitoring.v3.GroupName)3 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)3 ApiOperation (com.wordnik.swagger.annotations.ApiOperation)3 URI (java.net.URI)3 Date (java.util.Date)3 DefaultValue (javax.ws.rs.DefaultValue)3 HeaderParam (javax.ws.rs.HeaderParam)3 Produces (javax.ws.rs.Produces)3 Response (javax.ws.rs.core.Response)3 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)3 Artifact (org.eclipse.bpmn2.Artifact)3