@Override public void setSize(final Dimension size) { final Dimension oldSize = getSize(); if (size != null && !size.equals(oldSize)) { super.setSize(size); updateShape(oldSize.width, oldSize.height); } }
@Override public void setShape(Shape shape) { final Dimension oldSize = getSize(); final Shape currentShape = getShape(); if (shape != null && !shape.equals(currentShape)) { super.setShape(shape); updateShape(oldSize.width, oldSize.height); } }
@Override public void setLabel(final String label) { super.setLabel(label); graphController.updateSVGDocument( new Runnable() { @Override public void run() { labelText.setData(label); } }); }
@Override public void setCompleted(final float complete) { super.setCompleted(complete); graphController.updateSVGDocument( new Runnable() { @Override public void run() { Dimension size = getSize(); Point position = getPosition(); completedPolygon.setAttribute( SVG_POINTS_ATTRIBUTE, calculatePoints(getShape(), (int) (size.width * complete), size.height)); completedPolygon.setAttribute( SVG_TRANSFORM_ATTRIBUTE, "translate(" + position.x + " " + position.y + ")"); } }); }
@Override public void addSubgraph(Graph subgraph) { super.addSubgraph(subgraph); if (subgraph instanceof SVGGraph) { final SVGGraph svgGraph = (SVGGraph) subgraph; graphController.updateSVGDocument( new Runnable() { @Override public void run() { float opacity = svgGraph.getOpacity(); svgGraph.setOpacity(0); mainGroup.appendChild(svgGraph.getSVGElement()); svgGraph.setOpacity(opacity); } }); } }
@Override public void addNode(GraphNode node) { super.addNode(node); if (node instanceof SVGGraphNode) { final SVGGraphNode svgGraphNode = (SVGGraphNode) node; graphController.updateSVGDocument( new Runnable() { @Override public void run() { float opacity = svgGraphNode.getOpacity(); svgGraphNode.setOpacity(0); mainGroup.appendChild(svgGraphNode.getSVGElement()); svgGraphNode.setOpacity(opacity); } }); } }
@Override public void addEdge(GraphEdge edge) { if (edge instanceof SVGGraphEdge) { final SVGGraphEdge svgGraphEdge = (SVGGraphEdge) edge; graphController.updateSVGDocument( new Runnable() { @Override public void run() { float opacity = svgGraphEdge.getOpacity(); svgGraphEdge.setOpacity(0); mainGroup.appendChild(svgGraphEdge.getSVGElement()); svgGraphEdge.setOpacity(opacity); } }); } super.addEdge(edge); }
@Override public void setPosition(final Point position) { final Point oldPosition = getPosition(); if (position != null && !position.equals(oldPosition)) { super.setPosition(position); graphController.updateSVGDocument( new Runnable() { @Override public void run() { if (graphController.isAnimatable()) animate( animatePosition, polygon, graphController.getAnimationSpeed(), oldPosition.x + ", " + oldPosition.y, position.x + ", " + position.y); else polygon.setAttribute( SVG_TRANSFORM_ATTRIBUTE, "translate(" + position.x + " " + position.y + ")"); } }); } }
@Override public void setLabelPosition(final Point labelPosition) { final Point oldLabelPosition = getLabelPosition(); if (labelPosition != null && !labelPosition.equals(oldLabelPosition)) { super.setLabelPosition(labelPosition); graphController.updateSVGDocument( new Runnable() { @Override public void run() { if (graphController.isAnimatable() && oldLabelPosition != null) animate( animateLabel, labelGroup, graphController.getAnimationSpeed(), oldLabelPosition.x + ", " + oldLabelPosition.y, labelPosition.x + ", " + labelPosition.y); else labelGroup.setAttribute( SVG_TRANSFORM_ATTRIBUTE, "translate(" + labelPosition.x + " " + labelPosition.y + ")"); } }); } }
@Override public void setOpacity(final float opacity) { delegate.setOpacity(opacity); super.setOpacity(opacity); }
@Override public void setFiltered(final boolean filtered) { delegate.setFiltered(filtered); super.setFiltered(filtered); }
@Override public void setVisible(final boolean visible) { delegate.setVisible(visible); super.setVisible(visible); }
@Override public void setFillColor(final Color fillColor) { delegate.setFillColor(fillColor); super.setFillColor(fillColor); }
@Override public void setColor(final Color color) { delegate.setColor(color); super.setColor(color); }
@Override public void setLineStyle(final LineStyle lineStyle) { delegate.setLineStyle(lineStyle); super.setLineStyle(lineStyle); }
@Override public void setSelected(final boolean selected) { delegate.setSelected(selected); super.setSelected(selected); }