Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,21 @@
* @since 1.1
*/
public class TransientViewTreeNode {
private final TransientViewTreeNode parent;
private final Object bo;
private Object userData;
private Style style = Style.EMPTY;
private final List<TransientViewTreeNode> children = new ArrayList<>();

/**
* Private constructor to prevent direct instantiation
* @param parent the parent node. May be null.
* @param bo the business object to be included in the view.
* @see #createChild(TransientViewTreeNode, Object)
* @see #createRoot()
*/
private TransientViewTreeNode(final Object bo) {
private TransientViewTreeNode(final TransientViewTreeNode parent, final Object bo) {
this.parent = parent;
this.bo = bo;
}

Expand All @@ -58,7 +61,7 @@ private TransientViewTreeNode(final Object bo) {
* @return the new root node
*/
public static TransientViewTreeNode createRoot() {
return new TransientViewTreeNode(null);
return new TransientViewTreeNode(null, null);
}

/**
Expand All @@ -71,11 +74,19 @@ public static TransientViewTreeNode createChild(final TransientViewTreeNode pare
Objects.requireNonNull(parent, "parent must not be null");
Objects.requireNonNull(bo, "bo must not be null");

final TransientViewTreeNode child = new TransientViewTreeNode(bo);
final TransientViewTreeNode child = new TransientViewTreeNode(parent, bo);
parent.children.add(child);
return child;
}

/**
* Returns the parent node
* @return the parent of this transient view node
*/
public final TransientViewTreeNode getParent() {
return parent;
}

/**
* Returns the business object to include in the view
* @return the business object. Will return null if and only if the node is a root node.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ protected BaseConnectionNode() {

// Apply initial style
apply(FxStyle.DEFAULT);

// Set view order so that connections are drawn on top of siblings.
setViewOrder(-1.0);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
import org.osate.aadl2.Subcomponent;
import org.osate.aadl2.SubcomponentType;
import org.osate.ge.BusinessObjectSelection;
import org.osate.ge.StringUtil;
import org.osate.ge.aadl2.AadlImportsUtil;
import org.osate.ge.aadl2.internal.util.AadlPrototypeUtil;
import org.osate.ge.aadl2.internal.util.AgeAadlUtil;
Expand Down Expand Up @@ -943,7 +944,7 @@ public boolean equals(Object obj) {

@Override
public String getLabel() {
return this.category.toString() + " port";
return StringUtil.camelCaseToUser(category.toString()).toLowerCase() + " port";
}

public final PortCategory getCategory() {
Expand Down