protected void basicSetPresentationFigureBounds(Point2D.Double anchor, Point2D.Double lead) { if (getPresentationFigure() != null) { getPresentationFigure().setBounds(anchor, lead); } }
protected void drawPresentationFigure(Graphics2D g) { if (getPresentationFigure() != null) { getPresentationFigure().draw(g); } }
@Override public boolean contains(Point2D.Double p) { boolean contains = super.contains(p); if (!contains && getPresentationFigure() != null) { contains = getPresentationFigure().contains(p); } return contains; }
/** * Return the logcal display area. This method is delegated to the encapsulated * presentation figure. */ @Override public Rectangle2D.Double getBounds() { if (getPresentationFigure() == null) { return super.getBounds(); } return getPresentationFigure().getBounds(); }
@Override public void addNotify(Drawing drawing) { super.addNotify(drawing); if (getPresentationFigure() != null) { getPresentationFigure().addNotify(drawing); } }
@Override public void removeNotify(Drawing drawing) { super.removeNotify(drawing); if (getPresentationFigure() != null) { getPresentationFigure().removeNotify(drawing); } }
/** * Standard presentation method which is delegated to the encapsulated presentation figure. * The presentation figure is moved as well as all contained figures. */ @Override public void transform(AffineTransform tx) { super.transform(tx); if (getPresentationFigure() != null) { getPresentationFigure().transform(tx); } }
/** * Gets an attribute from the figure. */ @Override public <T> T get(AttributeKey<T> key) { if (getPresentationFigure() != null) { return getPresentationFigure().get(key); } else { return (!attributes.containsKey(key)) ? key.getDefaultValue() : key.get(attributes); } }
/** * Return the draw area. This method is delegated to the * encapsulated presentation figure. */ @Override public Rectangle2D.Double getDrawingArea() { Rectangle2D.Double r = super.getDrawingArea(); if (getPresentationFigure() != null) { r.add(getPresentationFigure().getDrawingArea()); } return r; }
/** * Sets an attribute of the figure. * AttributeKey name and semantics are defined by the class implementing * the figure interface. */ @Override public <T> void set(AttributeKey<T> key, T newValue) { if (forbiddenAttributes == null || !forbiddenAttributes.contains(key)) { if (getPresentationFigure() != null) { getPresentationFigure().set(key, newValue); } T oldValue = (T) key.put(attributes, newValue); fireAttributeChanged(key, oldValue, newValue); } }