/** * Sets the graph model that contains the data, and fires an * mxEvent.CHANGE followed by an mxEvent.REPAINT event. * * @param value Model that contains the graph data */ public void setModel(mxIGraphModel value) { if (model != null) { model.removeListener(graphModelChangeHandler); } Object oldModel = model; model = value; if (view != null) { view.revalidate(); } model.addListener(mxEvent.CHANGE, graphModelChangeHandler); changeSupport.firePropertyChange("model", oldModel, model); repaint(); }
/** * Sets the graph model that contains the data, and fires an * mxEvent.CHANGE followed by an mxEvent.REPAINT event. * * @param value Model that contains the graph data */ public void setModel(mxIGraphModel value) { if (model != null) { model.removeListener(graphModelChangeHandler); } Object oldModel = model; model = value; if (view != null) { view.revalidate(); } model.addListener(mxEvent.CHANGE, graphModelChangeHandler); changeSupport.firePropertyChange("model", oldModel, model); repaint(); }
/** * Sets the current scale and revalidates the view. Fires a "scale" event * after calling revalidate. Revalidate is only called if isEventsEnabled. * * @param value * New scale to be used. */ public void setScale(double value) { double previousScale = scale; if (scale != value) { scale = value; if (isEventsEnabled()) { revalidate(); } } fireEvent(new mxEventObject(mxEvent.SCALE, "scale", scale, "previousScale", previousScale)); }
/** * Sets the current scale and revalidates the view. Fires a "scale" event * after calling revalidate. Revalidate is only called if isEventsEnabled. * * @param value * New scale to be used. */ public void setScale(double value) { double previousScale = scale; if (scale != value) { scale = value; if (isEventsEnabled()) { revalidate(); } } fireEvent(new mxEventObject(mxEvent.SCALE, "scale", scale, "previousScale", previousScale)); }
/** * */ public void stopAnimation() { graphComponent.getGraph().getView().revalidate(); super.stopAnimation(); preview = null; if (dirty != null) { graphComponent.getGraphControl().repaint(dirty.getRectangle()); } }
/** * */ public void stopAnimation() { graphComponent.getGraph().getView().revalidate(); super.stopAnimation(); preview = null; if (dirty != null) { graphComponent.getGraphControl().repaint(dirty.getRectangle()); } }
/** * Sets the view that contains the cell states. * * @param value View that contains the cell states */ public void setView(mxGraphView value) { if (view != null) { view.removeListener(fullRepaintHandler); view.removeListener(updateOriginHandler); } Object oldView = view; view = value; if (view != null) { view.revalidate(); } // Listens to changes in the view view.addListener(mxEvent.SCALE, fullRepaintHandler); view.addListener(mxEvent.SCALE, updateOriginHandler); view.addListener(mxEvent.TRANSLATE, fullRepaintHandler); view.addListener(mxEvent.SCALE_AND_TRANSLATE, fullRepaintHandler); view.addListener(mxEvent.SCALE_AND_TRANSLATE, updateOriginHandler); view.addListener(mxEvent.UP, fullRepaintHandler); view.addListener(mxEvent.DOWN, fullRepaintHandler); changeSupport.firePropertyChange("view", oldView, view); }
/** * Sets the view that contains the cell states. * * @param value View that contains the cell states */ public void setView(mxGraphView value) { if (view != null) { view.removeListener(fullRepaintHandler); view.removeListener(updateOriginHandler); } Object oldView = view; view = value; if (view != null) { view.revalidate(); } // Listens to changes in the view view.addListener(mxEvent.SCALE, fullRepaintHandler); view.addListener(mxEvent.SCALE, updateOriginHandler); view.addListener(mxEvent.TRANSLATE, fullRepaintHandler); view.addListener(mxEvent.SCALE_AND_TRANSLATE, fullRepaintHandler); view.addListener(mxEvent.SCALE_AND_TRANSLATE, updateOriginHandler); view.addListener(mxEvent.UP, fullRepaintHandler); view.addListener(mxEvent.DOWN, fullRepaintHandler); changeSupport.firePropertyChange("view", oldView, view); }
/** * Sets the current translation and invalidates the view. Fires a property * change event for "translate" after calling revalidate. Revalidate is only * called if isEventsEnabled. * * @param value * New translation to be used. */ public void setTranslate(mxPoint value) { Object previousTranslate = translate.clone(); if (value != null && (value.getX() != translate.getX() || value.getY() != translate .getY())) { translate = value; if (isEventsEnabled()) { revalidate(); } } fireEvent(new mxEventObject(mxEvent.TRANSLATE, "translate", translate, "previousTranslate", previousTranslate)); }
/** * Sets the scale and translation. Fires a "scaleAndTranslate" event after * calling revalidate. Revalidate is only called if isEventsEnabled. * * @param scale * Decimal value that specifies the new scale (1 is 100%). * @param dx * X-coordinate of the translation. * @param dy * Y-coordinate of the translation. */ public void scaleAndTranslate(double scale, double dx, double dy) { double previousScale = this.scale; Object previousTranslate = translate.clone(); if (scale != this.scale || dx != translate.getX() || dy != translate.getY()) { this.scale = scale; translate = new mxPoint(dx, dy); if (isEventsEnabled()) { revalidate(); } } fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE, "scale", scale, "previousScale", previousScale, "translate", translate, "previousTranslate", previousTranslate)); }
/** * Sets the scale and translation. Fires a "scaleAndTranslate" event after * calling revalidate. Revalidate is only called if isEventsEnabled. * * @param scale * Decimal value that specifies the new scale (1 is 100%). * @param dx * X-coordinate of the translation. * @param dy * Y-coordinate of the translation. */ public void scaleAndTranslate(double scale, double dx, double dy) { double previousScale = this.scale; Object previousTranslate = translate.clone(); if (scale != this.scale || dx != translate.getX() || dy != translate.getY()) { this.scale = scale; translate = new mxPoint(dx, dy); if (isEventsEnabled()) { revalidate(); } } fireEvent(new mxEventObject(mxEvent.SCALE_AND_TRANSLATE, "scale", scale, "previousScale", previousScale, "translate", translate, "previousTranslate", previousTranslate)); }
/** * Sets the current translation and invalidates the view. Fires a property * change event for "translate" after calling revalidate. Revalidate is only * called if isEventsEnabled. * * @param value * New translation to be used. */ public void setTranslate(mxPoint value) { Object previousTranslate = translate.clone(); if (value != null && (value.getX() != translate.getX() || value.getY() != translate .getY())) { translate = value; if (isEventsEnabled()) { revalidate(); } } fireEvent(new mxEventObject(mxEvent.TRANSLATE, "translate", translate, "previousTranslate", previousTranslate)); }
canvas.setScale(1 / pageScale); view.revalidate();
canvas.setScale(1 / pageScale); view.revalidate();
graph.getView().revalidate();
graph.getView().revalidate();