Example usage for java.awt Point getY

List of usage examples for java.awt Point getY

Introduction

In this page you can find the example usage for java.awt Point getY.

Prototype

public double getY() 

Source Link

Usage

From source file:it.unibo.alchemist.boundary.monitors.Generic2DDisplay.java

private Shape convertObstacle(final Obstacle2D o) {
    final Rectangle2D r = o.getBounds2D();
    final Position[] points = new Position[] { new Continuous2DEuclidean(r.getX(), r.getY()),
            new Continuous2DEuclidean(r.getX() + r.getWidth(), r.getY()),
            new Continuous2DEuclidean(r.getX() + r.getWidth(), r.getY() + r.getHeight()),
            new Continuous2DEuclidean(r.getX(), r.getY() + r.getHeight()) };
    final Path2D path = new GeneralPath();
    for (int i = 0; i < points.length; i++) {
        final Point pt = wormhole.getViewPoint(points[i]);
        if (i == 0) {
            path.moveTo(pt.getX(), pt.getY());
        }/*from   www.j  a  v  a2  s  .c om*/
        path.lineTo(pt.getX(), pt.getY());
    }
    path.closePath();
    return path;
}

From source file:net.chaosserver.timelord.swingui.Timelord.java

/**
 * Saves the current location of the applicatioFrame.
 *///from  w w  w  . j  av a  2  s  .c  o  m
protected void saveFrameLocation() {
    if (applicationFrame != null) {
        Point frameLocation = applicationFrame.getLocation();

        Preferences preferences = Preferences.userNodeForPackage(this.getClass());
        preferences.putDouble(FRAME_X_LOCATION, frameLocation.getX());
        preferences.putDouble(FRAME_Y_LOCATION, frameLocation.getY());
    }
}

From source file:org.nekorp.workflow.desktop.servicio.reporte.orden.servicio.OrdenServicioDataFactory.java

private void generaImagenDamage(ShapeView fondo, List<DamageDetailsVB> danios, File outputfile, int width,
        int height) {
    try {/*from   w w  w .j a  v a2  s.c  o  m*/
        Point contexto = new Point((width - fondo.getShapeWidth()) / 2, (height - fondo.getShapeHeight()) / 2);
        BufferedImage off_Image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2 = off_Image.createGraphics();
        g2.setColor(Color.WHITE);
        g2.fillRect(0, 0, width, height);
        AffineTransform saveXform = g2.getTransform();
        AffineTransform toCenterAt = new AffineTransform();
        toCenterAt.translate(contexto.getX(), contexto.getY());
        g2.transform(toCenterAt);
        fondo.paint(g2);
        g2.setTransform(saveXform);
        for (DamageDetailsVB x : danios) {
            DamageDetailGraphicsView obj = new DamageDetailGraphicsView();
            obj.setPosicion(new Point(x.getX(), x.getY()));
            obj.setContexto(contexto);
            if (x.getX() <= fondo.getShapeWidth() / 2) {
                if (x.getY() <= fondo.getShapeHeight() / 2) {
                    obj.setOrientacion(DamageDetailGraphicsView.SuperiorIzquierda);
                } else {
                    obj.setOrientacion(DamageDetailGraphicsView.InferiorIzquierda);
                }
            } else {
                if (x.getY() <= fondo.getShapeHeight() / 2) {
                    obj.setOrientacion(DamageDetailGraphicsView.SuperiorDerecha);
                } else {
                    obj.setOrientacion(DamageDetailGraphicsView.InferiorDerecha);
                }
            }
            obj.setCategoria(x.getCategoria());
            obj.setCaracteristica(x.getCaracteristica());
            obj.paint(g2);
        }
        saveJPG(off_Image, outputfile);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}

From source file:business.ImageManager.java

private void doDrawPath(Graphics2D big, Point ori, Point dest, Color color) {
    //setup para os rastros
    big.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    big.setStroke(new BasicStroke(0.75f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f,
            new float[] { 3f, 5f, 7f, 5f, 11f, 5f, 15f, 5f, 21f, 5f, 27f, 5f, 33f, 5f }, 0f));
    big.setColor(color);/*w  w  w.ja va 2  s .  c  om*/
    //draw path
    Path2D.Double path = new Path2D.Double();
    path.moveTo(ori.getX(), ori.getY());
    path.lineTo(dest.getX(), dest.getY());

    //draw on graph
    big.draw(path);
}

From source file:business.ImageManager.java

private void doDrawPathOrdem(Graphics2D big, Point ori, Point dest, Color color) {
    //setup para os rastros
    big.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    big.setStroke(new BasicStroke(1.75f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f,
            new float[] { 3f, 5f, 7f, 5f, 11f, 5f, 15f, 5f, 21f, 5f, 27f, 5f, 33f, 5f }, 0f));
    big.setColor(color);/*ww w.  j  a  v a  2 s.  co  m*/
    //draw path
    Path2D.Double path = new Path2D.Double();
    path.moveTo(ori.getX(), ori.getY());
    path.curveTo(dest.getX() - 20, dest.getY() + 20, dest.getX() + 20, dest.getY() - 20, dest.getX() + 12,
            dest.getY());
    //path.lineTo(dest.getX(), dest.getY());

    //draw on graph
    big.draw(path);
}

From source file:business.ImageManager.java

private void doDrawPathOrdemArmy(Graphics2D big, Point ori, Point dest, Color color) {
    //setup para os rastros
    big.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    big.setComposite(alcom);// ww w  .  ja v a 2  s .  c om
    big.setStroke(new BasicStroke(3f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1f,
            new float[] { 3f, 5f, 7f, 5f, 11f, 5f, 15f, 5f, 21f, 5f, 27f, 5f, 33f, 5f }, 0f));
    big.setColor(color);
    //draw path
    Path2D.Double path = new Path2D.Double();
    path.moveTo(ori.getX(), ori.getY());
    path.curveTo(dest.getX() + 10, dest.getY() - 10, dest.getX() - 10, dest.getY() + 10, dest.getX(),
            dest.getY());

    //draw on graph
    big.draw(path);
}

From source file:org.martus.client.swingui.PureFxMainWindow.java

@Override
public void restoreWindowSizeAndState() {
    Dimension appDimension = getUiState().getCurrentAppDimension();
    Point appPosition = getUiState().getCurrentAppPosition();
    boolean showMaximized = getUiState().isCurrentAppMaximized();

    if (appDimension.getHeight() == 0 || appDimension.getWidth() == 0) {
        showMaximized = true;/*from w w  w. j a v a  2  s  .co m*/
    } else {
        realStage.setWidth(appDimension.getWidth());
        realStage.setHeight(getNonFullScreenHeight(appDimension.getHeight()));
    }

    realStage.setX(appPosition.getX());
    realStage.setY(appPosition.getY());
    realStage.setMaximized(showMaximized);

    getUiState().setCurrentAppDimension(getMainWindowSize());
}

From source file:com.projity.pm.graphic.spreadsheet.SpreadSheet.java

public boolean isOnIcon(MouseEvent e) {
    Point p = e.getPoint();
    int row = rowAtPoint(p);
    int col = columnAtPoint(p);
    Rectangle bounds = getCellRect(row, col, false);
    SpreadSheetModel model = (SpreadSheetModel) getModel();
    GraphicNode node = model.getNode(row);
    return NameCellComponent.isOnIcon(
            new Point((int) (p.getX() - bounds.getX()), (int) (p.getY() - bounds.getY())), bounds.getSize(),
            model.getCache().getLevel(node));
}

From source file:com.projity.pm.graphic.spreadsheet.SpreadSheet.java

public boolean isOnText(MouseEvent e) {
    Point p = e.getPoint();
    int row = rowAtPoint(p);
    int col = columnAtPoint(p);
    Rectangle bounds = getCellRect(row, col, false);
    SpreadSheetModel model = (SpreadSheetModel) getModel();
    GraphicNode node = model.getNode(row);
    return NameCellComponent.isOnText(
            new Point((int) (p.getX() - bounds.getX()), (int) (p.getY() - bounds.getY())), bounds.getSize(),
            model.getCache().getLevel(node));
}

From source file:org.processmining.analysis.performance.advanceddottedchartanalysis.ui.DottedChartPanel.java

/**
 * adjusts the viewable are of the log (zoom)
 * /* w w  w .  j av a2 s.c  om*/
 * @param aZoom
 *            fraction of the log to be viewable (within (0,1] !)
 */
public void setViewportZoomY(double aZoom) {
    if (aZoom > 1.0) { // ensure sane values
        viewportZoomY = 1.0;
    } else if (aZoom <= 0.0) {
        viewportZoomY = 0.00000000001;
    } else {
        viewportZoomY = aZoom;
    }
    double ratio = updHight;
    updHight = (int) (getParent().getHeight() * (1.0 / aZoom));
    ratio = updHight / ratio;
    Dimension dim = new Dimension(updWidth, updHight);
    Point d = dca.getScrollPane().getViewport().getViewPosition();
    Point p = new Point((int) d.getX(), (int) (d.getY() * ratio));
    this.setPreferredSize(dim);
    coUtil.updateMilli2pixelsRatio(this.getWidth(), BORDER);

    this.revalidate();
    dca.setScrollBarPosition(p);
}