protected Point real2screen( int x, int y ) { Point screen = new Point( x + offset.x, y + offset.y ); return screen; }
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(); }
private BufferedImage generateJobImage( JobMeta jobMeta ) throws Exception { float magnification = 1.0f; Point maximum = jobMeta.getMaximum(); maximum.multiply( magnification ); SwingGC gc = new SwingGC( null, maximum, 32, 0, 0 ); JobPainter jobPainter = new JobPainter( gc, jobMeta, maximum, null, null, null, null, null, new ArrayList<AreaOwner>(), new ArrayList<JobEntryCopy>(), 32, 1, 0, 0, true, "Arial", 10 ); jobPainter.setMagnification( magnification ); jobPainter.drawJob(); BufferedImage image = (BufferedImage) gc.getImage(); return image; }
public Point getImageBounds( EImage image ) { return new Point( small_icon_size, small_icon_size ); }
public Point getImageBounds( EImage image ) { return new Point( small_icon_size, small_icon_size ); }
public Point getImageBounds( EImage image ) { return new Point( small_icon_size, small_icon_size ); }
public Point getImageBounds( EImage image ) { return new Point( small_icon_size, small_icon_size ); }
public void setPosition( Object[] obj, int[] idx, Point[] prev, Point[] curr ) { if ( prev.length != curr.length ) { return; } previous_location = new Point[prev.length]; current_location = new Point[curr.length]; current = obj; current_index = idx; for ( int i = 0; i < prev.length; i++ ) { previous_location[i] = new Point( prev[i].x, prev[i].y ); current_location[i] = new Point( curr[i].x, curr[i].y ); } Object fobj = obj[0]; if ( fobj instanceof StepMeta ) { type = TYPE_ACTION_POSITION_STEP; } if ( fobj instanceof NotePadMeta ) { type = TYPE_ACTION_POSITION_NOTE; } if ( fobj instanceof JobEntryCopy ) { type = TYPE_ACTION_POSITION_JOB_ENTRY; } }
public NotePadMeta( String n, int xl, int yl, int w, int h, String fontname, int fontsize, boolean fontbold, boolean fontitalic, int fontColorRed, int fontColorGreen, int fontColorBlue, int backGrounColorRed, int backGrounColorGreen, int backGrounColorBlue, int borderColorRed, int borderColorGreen, int borderColorBlue, boolean drawshadow ) { this.note = n; this.location = new Point( xl, yl ); this.width = w; this.height = h; this.selected = false; this.fontname = fontname; this.fontsize = fontsize; this.fontbold = fontbold; this.fontitalic = fontitalic; // font color this.fontcolorred = fontColorRed; this.fontcolorgreen = fontColorGreen; this.fontcolorblue = fontColorBlue; // background color this.backgroundcolorred = backGrounColorRed; this.backgroundcolorgreen = backGrounColorGreen; this.backgroundcolorblue = backGrounColorBlue; // border color this.bordercolorred = borderColorRed; this.bordercolorgreen = borderColorGreen; this.bordercolorblue = borderColorBlue; this.drawshadow = drawshadow; }
public SwingGC( Graphics2D gc, Rectangle2D rect, int iconsize, int xOffset, int yOffset ) throws KettleException { this( null, gc, null, new Point( (int) rect.getWidth(), (int) rect.getHeight() ), iconsize, xOffset, yOffset ); }
protected Point magnifyPoint( Point p ) { return new Point( Math.round( p.x * magnification ), Math.round( p.y * magnification ) ); }
protected Point magnifyPoint( Point p ) { return new Point( Math.round( p.x * magnification ), Math.round( p.y * magnification ) ); }
public NotePadMeta( String n, int xl, int yl, int w, int h ) { note = n; location = new Point( xl, yl ); width = w; height = h; selected = false; setDefaultFont(); }
@Override public void setLocation( int x, int y ) { int nx = ( x >= 0 ? x : 0 ); int ny = ( y >= 0 ? y : 0 ); Point loc = new Point( nx, ny ); if ( !loc.equals( location ) ) { setChanged(); } location = loc; }
public Point textExtent( String text ) { String[] lines = text.split( Const.CR ); int maxWidth = 0; for ( String line : lines ) { Rectangle2D bounds = TextUtilities.getTextBounds( line, gc, gc.getFontMetrics() ); if ( bounds.getWidth() > maxWidth ) { maxWidth = (int) bounds.getWidth(); } } int height = gc.getFontMetrics().getHeight() * lines.length; return new Point( maxWidth, height ); }
public Point real2screen( int x, int y ) { offset = getOffset(); Point screen = new Point( x + offset.x, y + offset.y ); return screen; }
public NotePadMeta() { note = null; location = new Point( -1, -1 ); width = -1; height = -1; selected = false; setDefaultFont(); backgroundcolorred = 0xFF; backgroundcolorgreen = 0xA5; backgroundcolorblue = 0x00; }
public void setLocation( int x, int y ) { int nx = ( x >= 0 ? x : 0 ); int ny = ( y >= 0 ? y : 0 ); Point loc = new Point( nx, ny ); if ( !loc.equals( location ) ) { setChanged(); } location = loc; }
protected Point getOffset( Point thumb, Point area ) { Point p = new Point( 0, 0 ); Point sel = new Point( hori.getSelection(), vert.getSelection() ); if ( thumb.x == 0 || thumb.y == 0 ) { return p; } p.x = Math.round( -sel.x * area.x / thumb.x / magnification ); p.y = Math.round( -sel.y * area.y / thumb.y / magnification ); return p; }