public VarBadge(SuperNode superNode) { // mWorkSpace = ws; mSuperNode = superNode; // Initialize the entry list SuperNode parentNode = mSuperNode; mEntryList.clear(); while (parentNode != null) { Vector<VarDef> varDefList = parentNode.getVarDefList(); for (VarDef varDef : varDefList) { mEntryList.add( new Entry( parentNode, false, varDef.getConcreteSyntax(), varDef.getFormattedSyntax(), TextFormat.fillWithAttributes(varDef.getFormattedSyntax()).getSecond())); } parentNode = parentNode.getParentNode(); } // Initialize size and location setSize(new Dimension(1, 1)); setLocation( superNode.getVariableBadge().getPosition().getXPos(), superNode.getVariableBadge().getPosition().getYPos()); }
public void updateLocation(Point vector) { // Set new location setLocation(new Point(getLocation().x + vector.x, getLocation().y + vector.y)); // Set the location on data model mSuperNode.getVariableBadge().setPosition(new Position(getLocation().x, getLocation().y)); }