new TransPainter( gc, transMeta, area, bar, bar, null, null, null, new ArrayList<AreaOwner>(), new ArrayList<StepMeta>(), iconsize, 1, 0, 0, true, "FreeSans", 10 ); painter.setMagnification( magnification ); painter.setTranslationX( ( -min.x ) * magnification ); painter.setTranslationY( ( -min.y ) * magnification ); painter.buildTransformationImage();
private void drawHop( TransHopMeta hi ) { drawHop( hi, false ); }
private void drawHop( TransHopMeta hi, boolean isCandidate ) { StepMeta fs = hi.getFromStep(); StepMeta ts = hi.getToStep(); if ( fs != null && ts != null ) { drawLine( fs, ts, hi, isCandidate ); } }
private BufferedImage generateTransformationImage( TransMeta transMeta ) throws Exception { float magnification = 1.0f; Point maximum = transMeta.getMaximum(); maximum.multiply( magnification ); SwingGC gc = new SwingGC( null, maximum, 32, 0, 0 ); TransPainter transPainter = new TransPainter( gc, transMeta, maximum, null, null, null, null, null, new ArrayList<AreaOwner>(), new ArrayList<StepMeta>(), 32, 1, 0, 0, true, "Arial", 10 ); transPainter.setMagnification( magnification ); transPainter.buildTransformationImage(); return (BufferedImage) gc.getImage(); }
public Image getTransformationImage( Device device, int x, int y, float magnificationFactor ) { GCInterface gc = new SWTGC( device, new Point( x, y ), iconsize ); int gridSize = PropsUI.getInstance().isShowCanvasGridEnabled() ? PropsUI.getInstance().getCanvasGridSize() : 1; TransPainter transPainter = new TransPainter( gc, transMeta, new Point( x, y ), new SwtScrollBar( hori ), new SwtScrollBar( vert ), candidate, drop_candidate, selectionRegion, areaOwners, mouseOverSteps, PropsUI.getInstance().getIconSize(), PropsUI.getInstance().getLineWidth(), gridSize, PropsUI.getInstance().getShadowSize(), PropsUI.getInstance() .isAntiAliasingEnabled(), PropsUI.getInstance().getNoteFont().getName(), PropsUI.getInstance() .getNoteFont().getHeight(), trans, PropsUI.getInstance().isIndicateSlowTransStepsEnabled() ); transPainter.setMagnification( magnificationFactor ); transPainter.setStepLogMap( stepLogMap ); transPainter.setStartHopStep( startHopStep ); transPainter.setEndHopLocation( endHopLocation ); transPainter.setNoInputStep( noInputStep ); transPainter.setEndHopStep( endHopStep ); transPainter.setCandidateHopType( candidateHopType ); transPainter.setStartErrorHopStep( startErrorHopStep ); transPainter.setShowTargetStreamsStep( showTargetStreamsStep ); transPainter.buildTransformationImage(); Image img = (Image) gc.getImage(); gc.dispose(); return img; }
private void drawTrans( Point thumb ) { if ( !shadow && gridSize > 1 ) { drawGrid(); drawNote( ni ); drawHop( hi ); drawHop( candidate, true ); } else { if ( startHopStep != null && endHopLocation != null ) { Point start = real2screen( fr.x + iconsize / 2, fr.y + iconsize / 2 ); Point end = real2screen( to.x, to.y ); drawArrow( arrow, start.x, start.y, end.x, end.y, theta, calcArrowLength(), 1.2, null, startHopStep, endHopStep == null ? endHopLocation : endHopStep ); } else if ( endHopStep != null && endHopLocation != null ) { Point start = real2screen( fr.x, fr.y ); Point end = real2screen( to.x + iconsize / 2, to.y + iconsize / 2 ); drawArrow( arrow, start.x, start.y, end.x, end.y, theta, calcArrowLength(), 1.2, null, startHopStep == null ? endHopLocation : startHopStep, endHopStep ); StepMeta stepMeta = transMeta.getStep( i ); if ( stepMeta.isDrawn() ) { drawStep( stepMeta ); StepMeta stepMeta = transMeta.getStep( i ); if ( stepMeta.isDrawn() ) { checkDrawSlowStepIndicator( stepMeta );
Point screen = real2screen( pt.x, pt.y ); int x = screen.x; int y = screen.y; drawArrow( EImage.ARROW_DISABLED, x - iconsize / 2, point.y + textExtent.y / 2, x + iconsize / 3, y, Math.toRadians( 15 ), 15, 1.8, null, null, null ); drawArrow( EImage.ARROW_DISABLED, x + 2 * iconsize / 3, y, x + iconsize + iconsize / 2, point.y + textExtent.y / 2, Math .toRadians( 15 ), 15, 1.8, null, null, null ); Point namePosition = getNamePosition( name, screen, iconsize ); int areaX = translateToCurrentScale( x ) + translateToCurrentScale( iconsize ) / 2 - totalWidth / 2 + MINI_ICON_SKEW; int areaY = translateToCurrentScale( y ) + translateToCurrentScale( iconsize ) + MINI_ICON_DISTANCE + BasePainter.CONTENT_MENU_INDENT; areaOwners.add( new AreaOwner( AreaType.MINI_ICONS_BALLOON, translateTo1To1( areaX ), translateTo1To1( areaY ), translateTo1To1( totalWidth ), translateTo1To1( totalHeight ), offset, stepMeta, ioMeta ) ); case 0: // INPUT enabled = ioMeta.isInputAcceptor() || ioMeta.isInputDynamic(); areaOwners.add( new AreaOwner( AreaType.STEP_INPUT_HOP_ICON, translateTo1To1( xIcon ), translateTo1To1( yIcon ), translateTo1To1( bounds.x ), translateTo1To1( bounds.y ), offset, stepMeta, ioMeta ) ); break; case 1: // EDIT enabled = true; areaOwners.add( new AreaOwner( AreaType.STEP_EDIT_ICON, translateTo1To1( xIcon ), translateTo1To1( yIcon ), translateTo1To1( bounds.x ), translateTo1To1( bounds.y ), offset, stepMeta, ioMeta ) );
List<AreaOwner> areaOwners = new ArrayList<AreaOwner>(); TransPainter painter = new TransPainter( gc, transMeta, area, bar, bar, null, null, null, areaOwners, new ArrayList<StepMeta>(), iconsize, 1, 0, 0, true, "FreeSans", 10 ); painter.setMagnification( 0.5f ); painter.setTranslationX( min.x ); painter.setTranslationY( min.y ); painter.buildTransformationImage(); BufferedImage bufferedImage = (BufferedImage) gc.getImage(); int newWidth = bufferedImage.getWidth() - min.x;