public static String Alert( ScriptEngine actualContext, Bindings actualObject, Object[] ArgList, Object FunctionContext ) { SpoonInterface spoon = SpoonFactory.getInstance(); if ( ArgList.length == 1 && spoon != null ) { String strMessage = (String) ArgList[0]; spoon.messageBox( strMessage, "Alert", false, Const.INFO ); } return ""; }
public Point getNamePosition( String string, Point screen, int iconsize ) { Point textsize = gc.textExtent( string ); int xpos = screen.x + ( iconsize / 2 ) - ( textsize.x / 2 ); int ypos = screen.y + iconsize + 5; return new Point( xpos, ypos ); }
/** * Validate if a certain coordinate is contained in the area * * @param x * x-coordinate * @param y * y-coordinate * @return true if the specified coordinate is contained in the area */ public boolean contains( int x, int y ) { return area.contains( x, y ); }
public SwingDirectGC( Graphics2D gc, Rectangle2D rect, int iconsize, int xOffset, int yOffset ) throws KettleException { this.image = null; this.gc = gc; this.observer = null; this.stepImages = SwingGUIResource.getInstance().getStepImages(); this.entryImages = SwingGUIResource.getInstance().getEntryImages(); this.iconsize = iconsize; this.area = new Point( (int) rect.getWidth(), (int) rect.getHeight() ); this.xOffset = xOffset; this.yOffset = yOffset; init(); }
public static void setLocation( GUIPositionInterface guiElement, int x, int y ) { if ( x < 0 ) { x = 0; } if ( y < 0 ) { y = 0; } guiElement.setLocation( calculateGridPosition( new Point( x, y ) ) ); }
protected Point real2screen( int x, int y ) { Point screen = new Point( x + offset.x, y + offset.y ); return screen; }
private void drawTextRightAligned( String txt, int x, int y ) { int off = gc.textExtent( txt ).x; x -= off; gc.drawText( txt, x, y ); }
@Override public void drawImage( EImage image, int x, int y, float magnification, double angle ) { SwingUniversalImage img = getNativeImage( image ); drawImage( img, x, y, angle, small_icon_size ); }
public void drawImage( EImage image, int locationX, int locationY, float magnification ) { SwingUniversalImage img = getNativeImage( image ); drawImage( img, locationX, locationY, small_icon_size ); // gc.drawImage(img, locationX+xOffset, locationY+yOffset, observer); }
public AreaOwner( Object extensionAreaType, int x, int y, int width, int heigth, Point offset, Object parent, Object owner ) { super(); this.extensionAreaType = extensionAreaType; this.area = new Rectangle( x - offset.x, y - offset.y, width, heigth ); this.parent = parent; this.owner = owner; }
protected void drawGrid() { Point bounds = gc.getDeviceBounds(); for ( int x = 0; x < bounds.x; x += gridSize ) { for ( int y = 0; y < bounds.y; y += gridSize ) { gc.drawPoint( x + ( offset.x % gridSize ), y + ( offset.y % gridSize ) ); } } }
@Override public int compareTo( TextFileInputFieldInterface field ) { return position - field.getPosition(); }
private SwingGUIResource() { this.stepImages = loadStepImages(); this.entryImages = loadEntryImages(); }
public static SwingGUIResource getInstance() { if ( instance == null ) { instance = new SwingGUIResource(); } return instance; }
@Override public void drawImage( EImage image, int x, int y ) { drawImage( image, x, y, 0.0f ); }
@Override public void drawJobEntryIcon( int x, int y, JobEntryCopy jobEntryCopy ) { drawJobEntryIcon( x, y, jobEntryCopy, 1.0f ); }
public SwingDirectGC( ImageObserver observer, Point area, int iconsize, int xOffset, int yOffset ) throws KettleException { this.image = new BufferedImage( area.x, area.y, BufferedImage.TYPE_INT_ARGB ); this.gc = image.createGraphics(); this.observer = observer; this.stepImages = SwingGUIResource.getInstance().getStepImages(); this.entryImages = SwingGUIResource.getInstance().getEntryImages(); this.iconsize = iconsize; this.area = area; this.xOffset = xOffset; this.yOffset = yOffset; init(); }
public void run() { result[0] = SpoonFactory.getInstance().messageBox( message, text, true, Const.INFO ); } } );
@Override public void drawImage( EImage image, int locationX, int locationY, float magnification ) { SwingUniversalImage img = getNativeImage( image ); drawImage( img, locationX, locationY, small_icon_size ); // gc.drawImage(img, locationX+xOffset, locationY+yOffset, observer); }
public void drawImage( EImage image, int x, int y, int width, int height, float magnification ) { SwingUniversalImage img = getNativeImage( image ); drawImage( img, x, y, width, height ); }