/** * * @param graphComponent */ public mxConnectPreview(mxGraphComponent graphComponent) { this.graphComponent = graphComponent; // Installs the paint handler graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } }); }
/** * Constructs a new morphing instance for the given graph. */ public mxMorphing(mxGraphComponent graphComponent) { this(graphComponent, 6, 1.5, DEFAULT_DELAY); // Installs the paint handler graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } }); }
/** * Constructs a new morphing instance for the given graph. */ public mxMorphing(mxGraphComponent graphComponent) { this(graphComponent, 6, 1.5, DEFAULT_DELAY); // Installs the paint handler graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } }); }
/** * Constructs a new rubberband selection for the given graph component. * * @param graphComponent Component that contains the rubberband. */ public mxMovePreview(mxGraphComponent graphComponent) { this.graphComponent = graphComponent; // Installs the paint handler graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } }); }
/** * Constructs a new rubberband selection for the given graph component. * * @param graphComponent Component that contains the rubberband. */ public mxMovePreview(mxGraphComponent graphComponent) { this.graphComponent = graphComponent; // Installs the paint handler graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } }); }
/** * * @param graphComponent */ public mxConnectPreview(mxGraphComponent graphComponent) { this.graphComponent = graphComponent; // Installs the paint handler graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } }); }
private void multiEditSpotName( final ArrayList< mxCell > vertices, final EventObject triggerEvent ) { /* * We want to display the editing window in the cell that is the closer * to where the user clicked. That is not perfect, because we can * imagine the click is made for from the selected cells, and that the * editing window will not even be displayed on the screen. No idea for * that yet, because JGraphX is expecting to receive a cell as location * for the editing window. */ final mxCell tc = getClosestCell( vertices ); vertices.remove( tc ); final mxGraphComponent graphComponent = trackScheme.getGUI().graphComponent; graphComponent.startEditingAtCell( tc, triggerEvent ); graphComponent.addListener( mxEvent.LABEL_CHANGED, new mxIEventListener() { @Override public void invoke( final Object sender, final mxEventObject evt ) { for ( final mxCell lCell : vertices ) { lCell.setValue( tc.getValue() ); trackScheme.getGraph().getSpotFor( lCell ).setName( tc.getValue().toString() ); } graphComponent.refresh(); graphComponent.removeListener( this ); } } ); }
private void multiEditSpotName( final ArrayList< mxCell > vertices, final EventObject triggerEvent ) { /* * We want to display the editing window in the cell that is the closer * to where the user clicked. That is not perfect, because we can * imagine the click is made for from the selected cells, and that the * editing window will not even be displayed on the screen. No idea for * that yet, because JGraphX is expecting to receive a cell as location * for the editing window. */ final mxCell tc = getClosestCell( vertices ); vertices.remove( tc ); final mxGraphComponent graphComponent = trackScheme.getGUI().graphComponent; graphComponent.startEditingAtCell( tc, triggerEvent ); graphComponent.addListener( mxEvent.LABEL_CHANGED, new mxIEventListener() { @Override public void invoke( final Object sender, final mxEventObject evt ) { for ( final mxCell lCell : vertices ) { lCell.setValue( tc.getValue() ); trackScheme.getGraph().getSpotFor( lCell ).setName( tc.getValue().toString() ); } graphComponent.refresh(); graphComponent.removeListener( this ); } } ); }
/** * */ public mxInsertHandler(mxGraphComponent graphComponent, String style) { this.graphComponent = graphComponent; this.style = style; // Installs the paint handler graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } }); // Listens to all mouse events on the rendering control graphComponent.getGraphControl().addMouseListener(this); graphComponent.getGraphControl().addMouseMotionListener(this); }
/** * */ public mxInsertHandler(mxGraphComponent graphComponent, String style) { this.graphComponent = graphComponent; this.style = style; // Installs the paint handler graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } }); // Listens to all mouse events on the rendering control graphComponent.getGraphControl().addMouseListener(this); graphComponent.getGraphControl().addMouseMotionListener(this); }
graphComponent.getGraphControl().addMouseMotionListener(this); graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener()
graphComponent.getGraphControl().addMouseMotionListener(this); graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener()
graphComponent.addListener(mxEvent.PAINT, new mxIEventListener()
graphComponent.addListener(mxEvent.PAINT, new mxIEventListener()
/** * Constructs a new rotation handler. */ public mxRotationHandler(mxGraphComponent graphComponent) { this.graphComponent = graphComponent; graphComponent.addMouseListener(this); handle = createHandle(); // Installs the paint handler graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } }); // Listens to all mouse events on the rendering control graphComponent.getGraphControl().addMouseListener(this); graphComponent.getGraphControl().addMouseMotionListener(this); // Needs to catch events because these are consumed handle.addMouseListener(this); handle.addMouseMotionListener(this); }
/** * Constructs a new rotation handler. */ public mxRotationHandler(mxGraphComponent graphComponent) { this.graphComponent = graphComponent; graphComponent.addMouseListener(this); handle = createHandle(); // Installs the paint handler graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener() { public void invoke(Object sender, mxEventObject evt) { Graphics g = (Graphics) evt.getProperty("g"); paint(g); } }); // Listens to all mouse events on the rendering control graphComponent.getGraphControl().addMouseListener(this); graphComponent.getGraphControl().addMouseMotionListener(this); // Needs to catch events because these are consumed handle.addMouseListener(this); handle.addMouseMotionListener(this); }
graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener()
graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener()
graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener()
graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener()