use of ucar.nc2.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);
}
}
}
use of ucar.nc2.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);
}
}
}
use of ucar.nc2.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++]);
}
}
}
use of ucar.nc2.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);
}
use of ucar.nc2.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);
}
Aggregations