public double getCenterX() { return (getX() + (getWidth() / 2)); }
public boolean setSize(double w, double h) { return setBounds(getX(), getY(), w, h); }
/** * Populate the specified layout constraint */ public void populateLayoutConstraint(LayoutConstraint constraint) { if (constraint instanceof LabelLayoutConstraint) { LabelLayoutConstraint labelConstraint = (LabelLayoutConstraint) constraint; labelConstraint.label = fullText; labelConstraint.pointSize = 18; } else if (constraint instanceof BasicEntityConstraint) { BasicEntityConstraint basicEntityConstraint = (BasicEntityConstraint) constraint; if (this.hasPreferredLocation()) { basicEntityConstraint.hasPreferredLocation = true; basicEntityConstraint.preferredX = this.getX(); basicEntityConstraint.preferredY = this.getY(); } } }
/** * Sets the bounds of this node based on the icon and text size. Takes into consideration the * maximum node width too. */ private void updateBounds() { PBounds textBounds = textNode.getBounds(); double w = (3 * PADDING_X) + iconWidth + ICON_GAP + textBounds.getWidth(); double h = (2 * PADDING_Y) + Math.max(iconHeight, textBounds.getHeight()); setBounds(getX(), getY(), w, h); }
private GradientPaint updateGradientPaintPoints(GradientPaint gp) { int x = (int) getX(); int y = (int) getY(); int h = (int) getHeight(); GradientPaint gradient = new GradientPaint(x, y, gp.getColor1(), x, y + h, gp.getColor2(), gp.isCyclic()); return gradient; }
OWLEntity entity = (OWLEntity)graphNode.getUserObject(); out.println(entity.getIRI().toString() + "," + graphNode.getX() + "," + graphNode.getY());
@Override public boolean setBounds(double x, double y, double width, double height) { // TODO handle maximum width? boolean changed = super.setBounds(x, y, width, height); if (changed) { if (pImage != null) { pImage.setBounds(getX() + PADDING_X, getY() + PADDING_Y, iconWidth, iconHeight); } textNode.setBounds(getX() + PADDING_X + iconWidth + ICON_GAP, getY() + PADDING_Y, textNode.getWidth(), textNode.getHeight()); updateArcLocations(); invalidatePaint(); fireChangeListeners(); } return changed; }