Example usage for java.awt Cursor N_RESIZE_CURSOR

List of usage examples for java.awt Cursor N_RESIZE_CURSOR

Introduction

In this page you can find the example usage for java.awt Cursor N_RESIZE_CURSOR.

Prototype

int N_RESIZE_CURSOR

To view the source code for java.awt Cursor N_RESIZE_CURSOR.

Click Source Link

Document

The north-resize cursor type.

Usage

From source file:Main.java

public static void main(String[] args) {
    JFrame aWindow = new JFrame();
    aWindow.setBounds(200, 200, 200, 200);
    aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    aWindow.setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
    aWindow.setVisible(true);//from   ww w  .j a  va2s . c  o  m
}

From source file:base.BasePlayer.BedCanvas.java

void drawScreen(Graphics g) {

    if (Main.readingbeds) {
        buf.setColor(Draw.backColor);/*from w w w . j a  v a2  s . c  o  m*/
        buf.fillRect(Main.sidebarWidth - 4, 0, this.getWidth(), nodeImage.getHeight());
        buf.drawString("Loading tracks...", 10, Main.bedScroll.getViewport().getHeight());
        g.drawImage(bufImage, 0, 0, null);
        return;
    }
    if (this.trackDivider.size() > 0 && this.trackDivider.get(this.trackDivider.size() - 1) != 1.0) {
        for (int i = 0; i < Main.bedCanvas.trackDivider.size(); i++) {
            Main.bedCanvas.trackDivider.set(i,
                    ((i + 1) * (this.getHeight() / (double) trackDivider.size()) / this.getHeight()));
        }
    }

    drawSidebar();

    if (Settings.wallpaper == null) {
        buf.setColor(Draw.backColor);
        buf.fillRect(Main.sidebarWidth - 4, 0, this.getWidth(), this.getHeight());
    } else {

        buf.drawImage(Settings.wallpaper, Main.sidebarWidth - 4, 0, this);
        buf.setColor(Draw.backColor);
        buf.fillRect(Main.sidebarWidth - 4, 0, this.getWidth(), this.getHeight());
    }
    //buf.setColor(Color.gray);

    if (!zoomDrag && !resize) {

        try {

            drawNodes();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    if (resizer && !mouseDrag) {
        resizer = false;
    }
    if (resize) {
        buf.drawImage(nodeImage, Main.sidebarWidth - 4, 0, nodeImage.getWidth(),
                (int) (Main.vardivider * Main.varPaneDivider.getY()), null);
    } else {
        buf.drawImage(nodeImage, Main.sidebarWidth - 4, 0, null);
    }
    for (int i = 0; i < bedTrack.size(); i++) {
        if (i < bedTrack.size() - 1) {
            buf.setColor(Color.lightGray);
            buf.drawLine(0, (int) (trackDivider.get(i) * this.getHeight()), this.getWidth(),
                    (int) (trackDivider.get(i) * this.getHeight()));

            buf.setColor(Color.gray);
            buf.drawLine(0, (int) (trackDivider.get(i) * this.getHeight()) + 1, this.getWidth(),
                    (int) (trackDivider.get(i) * this.getHeight()) + 1);

            if (!lineZoomer && mouseY < (int) (trackDivider.get(i) * this.getHeight()) + 4
                    && mouseY > (int) (trackDivider.get(i) * this.getHeight()) - 4) {
                resizer = true;
                if (getCursor().getType() != Cursor.N_RESIZE_CURSOR) {
                    resizeDivider = i;
                    setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
                }
            }
        }
        if (bedTrack.get(i).graph && bedTrack.get(i).minvalue != Double.MAX_VALUE
                && bedTrack.get(i).getHead().getNext() != null) {
            if (!buf.getColor().equals(Color.white)) {
                buf.setColor(Color.white);
            }
            if (bedTrack.get(i).getLogscale().isSelected()) {
                scaletext = "Log scale [" + MethodLibrary.round(bedTrack.get(i).minvalue, 2) + ", "
                        + MethodLibrary.round(bedTrack.get(i).maxvalue, 2) + "]";

                scalewidth = buf.getFontMetrics().stringWidth(scaletext);
                buf.fillRoundRect(Main.sidebarWidth + 5,
                        (int) (trackDivider.get(i) * this.getHeight()) - 5 - (Main.defaultFontSize + 4),
                        scalewidth + 4, Main.defaultFontSize + 4, 4, 4);
                buf.setColor(Color.black);
                buf.drawString(scaletext, Main.sidebarWidth + 7,
                        (int) (trackDivider.get(i) * this.getHeight()) - 9);

            } else {
                scaletext = "Scale [" + MethodLibrary.round(bedTrack.get(i).minvalue, 2) + ", "
                        + MethodLibrary.round(bedTrack.get(i).maxvalue, 2) + "]";
                scalewidth = buf.getFontMetrics().stringWidth(scaletext);
                buf.fillRoundRect(Main.sidebarWidth + 5,
                        (int) (trackDivider.get(i) * this.getHeight()) - 5 - (Main.defaultFontSize + 4),
                        scalewidth + 4, Main.defaultFontSize + 4, 4, 4);
                buf.setColor(Color.black);
                buf.drawString(scaletext, Main.sidebarWidth + 7,
                        (int) (trackDivider.get(i) * this.getHeight()) - 9);
            }
            buf.setColor(Color.black);
        }
    }
    if (overlap) {

        drawInfo();
    }
    if (!resizer && !overlapping) {
        if (getCursor().getType() != Cursor.DEFAULT_CURSOR) {
            setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        }
    }
    if (Main.drawCanvas.splits.get(0).pixel > 1) {
        // Middle line      
        buf.setColor(Color.black);
        buf.setStroke(Draw.dashed);
        buf.drawLine((Main.drawCanvas.getDrawWidth()) / 2 + Main.sidebarWidth - 2, 0,
                ((Main.drawCanvas.getDrawWidth())) / 2 + Main.sidebarWidth - 2,
                Main.bedScroll.getViewport().getHeight());
        buf.drawLine(
                (int) ((Main.drawCanvas.getDrawWidth()) / 2 + Main.drawCanvas.splits.get(0).pixel
                        + Main.sidebarWidth - 2),
                0, (int) (((Main.drawCanvas.getDrawWidth())) / 2 + Main.drawCanvas.splits.get(0).pixel
                        + Main.sidebarWidth - 2),
                Main.bedScroll.getViewport().getHeight());
        //      buf.setStroke(Draw.doubleStroke);
        buf.setStroke(Draw.basicStroke);
    }
    for (int i = 1; i < Main.drawCanvas.splits.size(); i++) {
        buf.setColor(Color.gray);
        buf.fillRect(Main.drawCanvas.splits.get(i).offset - 3, 0, 5, this.getHeight());
        buf.setColor(Color.lightGray);
        buf.fillRect(Main.drawCanvas.splits.get(i).offset - 1, 0, 2, this.getHeight());

    }
    if (getCursor().getType() != Cursor.N_RESIZE_CURSOR) {

        drawZoom();
    }
    g.drawImage(bufImage, 0, 0, null);
}

From source file:org.gumtree.vis.hist2d.Hist2DPanel.java

private void changeSelectedMask(Point2D point) {
    switch (getMaskDragIndicator()) {
    case Cursor.MOVE_CURSOR:
        moveMask(point);//w  w  w .j  a v a  2 s  . co m
        break;
    case Cursor.W_RESIZE_CURSOR:
        if (((XYPlot) getChart().getPlot()).getDomainAxis().isInverted()) {
            changeMaskXMax(point.getX());
        } else {
            changeMaskXMin(point.getX());
        }
        break;
    case Cursor.E_RESIZE_CURSOR:
        if (((XYPlot) getChart().getPlot()).getDomainAxis().isInverted()) {
            changeMaskXMin(point.getX());
        } else {
            changeMaskXMax(point.getX());
        }
        break;
    case Cursor.N_RESIZE_CURSOR:
        if (((XYPlot) getChart().getPlot()).getRangeAxis().isInverted()) {
            changeMaskYMin(point.getY());
        } else {
            changeMaskYMax(point.getY());
        }
        break;
    case Cursor.S_RESIZE_CURSOR:
        if (((XYPlot) getChart().getPlot()).getRangeAxis().isInverted()) {
            changeMaskYMax(point.getY());
        } else {
            changeMaskYMin(point.getY());
        }
        break;
    case Cursor.NW_RESIZE_CURSOR:
        if (((XYPlot) getChart().getPlot()).getDomainAxis().isInverted()) {
            changeMaskXMax(point.getX());
        } else {
            changeMaskXMin(point.getX());
        }
        if (((XYPlot) getChart().getPlot()).getRangeAxis().isInverted()) {
            changeMaskYMin(point.getY());
        } else {
            changeMaskYMax(point.getY());
        }
        break;
    case Cursor.NE_RESIZE_CURSOR:
        if (((XYPlot) getChart().getPlot()).getDomainAxis().isInverted()) {
            changeMaskXMin(point.getX());
        } else {
            changeMaskXMax(point.getX());
        }
        if (((XYPlot) getChart().getPlot()).getRangeAxis().isInverted()) {
            changeMaskYMin(point.getY());
        } else {
            changeMaskYMax(point.getY());
        }
        break;
    case Cursor.SW_RESIZE_CURSOR:
        if (((XYPlot) getChart().getPlot()).getDomainAxis().isInverted()) {
            changeMaskXMax(point.getX());
        } else {
            changeMaskXMin(point.getX());
        }
        if (((XYPlot) getChart().getPlot()).getRangeAxis().isInverted()) {
            changeMaskYMax(point.getY());
        } else {
            changeMaskYMin(point.getY());
        }
        break;
    case Cursor.SE_RESIZE_CURSOR:
        if (((XYPlot) getChart().getPlot()).getDomainAxis().isInverted()) {
            changeMaskXMin(point.getX());
        } else {
            changeMaskXMax(point.getX());
        }
        if (((XYPlot) getChart().getPlot()).getRangeAxis().isInverted()) {
            changeMaskYMax(point.getY());
        } else {
            changeMaskYMin(point.getY());
        }
        break;
    default:
        break;
    }
    fireMaskUpdateEvent(getSelectedMask());
}

From source file:JavaXWin.java

public void mouseMoved(MouseEvent e) {
    if (!m_dragging) {
        if (e.getX() < CORNER) {
            setCursor(Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR));
        } else if (e.getX() > getWidth() - CORNER) {
            setCursor(Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR));
        } else {/*from  w w  w. j av a 2  s.c o m*/
            setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
        }
    }
}

From source file:org.gumtree.vis.hist2d.Hist2DPanel.java

protected int findCursorOnSelectedItem(int x, int y) {
    if (getSelectedMask() != null && !getSelectedMask().getRectangleFrame().isEmpty()) {
        Rectangle2D screenArea = getScreenDataArea();
        Rectangle2D maskArea = ChartMaskingUtilities
                .translateChartRectangle(getSelectedMask(), getScreenDataArea(), getChart())
                .getRectangleFrame();//from   w ww  . j a  va2s  . co  m
        Rectangle2D intersect = screenArea.createIntersection(maskArea);
        Point2D point = new Point2D.Double(x, y);
        double minX = maskArea.getMinX();
        double maxX = maskArea.getMaxX();
        double minY = maskArea.getMinY();
        double maxY = maskArea.getMaxY();
        double width = maskArea.getWidth();
        double height = maskArea.getHeight();
        if (!intersect.isEmpty() && screenArea.contains(point)) {
            //              if (y > minY && y < maxY) {
            //                 if (minX > screenArea.getMinX() + 1 
            //                       && minX < screenArea.getMaxX() - 1) {
            //                       if (x > minX - 4 && x < minX + (width < 8 ? width / 2 : 4)) {
            //                          return Cursor.W_RESIZE_CURSOR;
            //                       } 
            //                 }
            //                 if (maxX > screenArea.getMinX() + 1 
            //                       && maxX < screenArea.getMaxX() - 1) {
            //                       if (x > maxX - (width < 8 ? width / 2 : 4) && x < maxX + 4) {
            //                          return Cursor.E_RESIZE_CURSOR;
            //                       } 
            //                 }
            //              }
            if (height > 8 && width > 8) {
                Rectangle2D center = new Rectangle2D.Double(minX + 4, minY + 4, width - 8, height - 8);
                if (screenArea.createIntersection(center).contains(point)) {
                    return Cursor.MOVE_CURSOR;
                }
            }
            if (height > 8) {
                Rectangle2D west = new Rectangle2D.Double(minX - 4, minY + 4, width < 8 ? width / 2 + 4 : 8,
                        height - 8);
                if (screenArea.createIntersection(west).contains(point)) {
                    return Cursor.W_RESIZE_CURSOR;
                }
                Rectangle2D east = new Rectangle2D.Double(maxX - (width < 8 ? width / 2 : 4), minY + 4,
                        width < 8 ? width / 2 + 4 : 8, height - 8);
                if (screenArea.createIntersection(east).contains(point)) {
                    return Cursor.E_RESIZE_CURSOR;
                }
            }
            if (width > 8) {
                Rectangle2D north = new Rectangle2D.Double(minX + 4, minY - 4, width - 8,
                        height < 8 ? height / 2 + 4 : 8);
                if (screenArea.createIntersection(north).contains(point)) {
                    return Cursor.N_RESIZE_CURSOR;
                }
                Rectangle2D south = new Rectangle2D.Double(minX + 4, maxY - (height < 8 ? height / 2 : 4),
                        width - 8, height < 8 ? height / 2 + 4 : 8);
                if (screenArea.createIntersection(south).contains(point)) {
                    return Cursor.S_RESIZE_CURSOR;
                }
            }
            Rectangle2D northwest = new Rectangle2D.Double(minX - 4, minY - 4, width < 8 ? width / 2 + 4 : 8,
                    height < 8 ? height / 2 + 4 : 8);
            if (screenArea.createIntersection(northwest).contains(point)) {
                return Cursor.NW_RESIZE_CURSOR;
            }
            Rectangle2D northeast = new Rectangle2D.Double(maxX - (width < 8 ? width / 2 : 4), minY - 4,
                    width < 8 ? width / 2 + 4 : 8, height < 8 ? height / 2 + 4 : 8);
            if (screenArea.createIntersection(northeast).contains(point)) {
                return Cursor.NE_RESIZE_CURSOR;
            }
            Rectangle2D southwest = new Rectangle2D.Double(minX - 4, maxY - (height < 8 ? height / 2 : 4),
                    width < 8 ? width / 2 + 4 : 8, height < 8 ? height / 2 + 4 : 8);
            if (screenArea.createIntersection(southwest).contains(point)) {
                return Cursor.SW_RESIZE_CURSOR;
            }
            Rectangle2D southeast = new Rectangle2D.Double(maxX - (width < 8 ? width / 2 : 4),
                    maxY - (height < 8 ? height / 2 : 4), width < 8 ? width / 2 + 4 : 8,
                    height < 8 ? height / 2 + 4 : 8);
            if (screenArea.createIntersection(southeast).contains(point)) {
                return Cursor.SE_RESIZE_CURSOR;
            }
        }
        //           System.out.println("intersect X:[" + intersect.getMinX() + ", " + 
        //                 (intersect.getMinX() + intersect.getWidth()) + 
        //                 "], Y:[" + intersect.getMinY() + ", " + 
        //                 (intersect.getMinY() + intersect.getHeight()) +
        //                 "], x=" + point.getX() + ", y=" + point.getY() + 
        //                 " " + intersect.contains(point));
    }
    return Cursor.DEFAULT_CURSOR;
}

From source file:erigo.ctstream.CTstream.java

/**
 * /*from  w  ww.  ja v  a  2  s.  c  o m*/
 * mouseMoved
 * 
 * Implement the mouseMoved method defined by interface MouseMotionListener.
 * 
 * This method is part of our homemade window manager; specifically, this method
 * handles setting the appropriate mouse cursor based on where the user has
 * positioned the mouse on the JFrame window.
 * 
 * Why have we implemented our own window manager?  Since translucent panels
 * can only be contained within undecorated Frames (see comments in the top
 * header above) and since undecorated Frames don't support moving/resizing,
 * we implement our own basic "window manager" by catching mouse move and drag
 * events.
 * 
 * @author John P. Wilson
 * @see java.awt.event.MouseMotionListener#mouseMoved(java.awt.event.MouseEvent)
 */
@Override
public void mouseMoved(MouseEvent mouseEventI) {
    // System.err.println("mouseMoved: " + mouseEventI.getX() + "," + mouseEventI.getY());
    mouseCommandMode = NO_COMMAND;
    // Set mouse Cursor based on the current mouse position
    int commandMode = getGUIFrameCommandMode(mouseEventI.getPoint());
    switch (commandMode) {
    case NO_COMMAND:
        guiFrame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        break;
    case MOVE_FRAME:
        guiFrame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        break;
    case RESIZE_FRAME_NW:
        guiFrame.setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
        break;
    case RESIZE_FRAME_N:
        guiFrame.setCursor(new Cursor(Cursor.N_RESIZE_CURSOR));
        break;
    case RESIZE_FRAME_NE:
        guiFrame.setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));
        break;
    case RESIZE_FRAME_E:
        guiFrame.setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
        break;
    case RESIZE_FRAME_SE:
        guiFrame.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
        break;
    case RESIZE_FRAME_S:
        guiFrame.setCursor(new Cursor(Cursor.S_RESIZE_CURSOR));
        break;
    case RESIZE_FRAME_SW:
        guiFrame.setCursor(new Cursor(Cursor.SW_RESIZE_CURSOR));
        break;
    case RESIZE_FRAME_W:
        guiFrame.setCursor(new Cursor(Cursor.W_RESIZE_CURSOR));
        break;
    default:
        guiFrame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        break;
    }
}

From source file:base.BasePlayer.BedCanvas.java

@SuppressWarnings("unchecked")
public void mouseDragged(MouseEvent event) {
    switch (event.getModifiers()) {

    case InputEvent.BUTTON1_MASK: {
        if (sidebar) {
            return;
        }/* www  .  j av  a2s .  c  om*/
        this.mouseX = event.getX();
        this.mouseY = event.getY();

        if (resizer && this.getHeight() > this.trackDivider.size() * 20) {

            this.trackDivider.set(this.resizeDivider, mouseY / (double) this.getHeight());

            if ((positivelock || negative)
                    && this.trackDivider.get(this.resizeDivider) * this.getHeight() - preresizer >= 0) {
                positivelock = false;
                negative = false;
                preresize = mouseY;
                tempDivider = (ArrayList<Double>) trackDivider.clone();

            } else if ((!negative || negativelock)
                    && this.trackDivider.get(this.resizeDivider) * this.getHeight() - preresizer < 0) {
                negativelock = false;
                preresize = mouseY;
                tempDivider = (ArrayList<Double>) trackDivider.clone();
                negative = true;
            }

            if (negativelock) { // || (this.trackDivider.get(this.resizeDivider+1)*this.getHeight()) -(this.trackDivider.get(this.resizeDivider)*this.getHeight()) < 20) {
                this.trackDivider.set(this.resizeDivider,
                        (this.trackDivider.get(this.resizeDivider + 1) * this.getHeight() - 19)
                                / (double) this.getHeight());
            }
            if (positivelock) { // || (this.trackDivider.get(this.resizeDivider+1)*this.getHeight()) -(this.trackDivider.get(this.resizeDivider)*this.getHeight()) < 20) {
                this.trackDivider.set(this.resizeDivider, 19 / (double) this.getHeight());
            }
            if (this.trackDivider.get(this.resizeDivider) * this.getHeight() - preresizer < 0) {

                negative = true;
                positivelock = true;
                if (this.resizeDivider > 0) {

                    for (int i = 1; i < this.resizeDivider + 1; i++) {
                        if ((this.trackDivider.get(i) * this.getHeight())
                                - (this.trackDivider.get(i - 1) * this.getHeight()) < 20) {

                            this.trackDivider.set(i, ((this.trackDivider.get(i - 1) * this.getHeight()) + 19)
                                    / (double) this.getHeight());
                        } else {
                            positivelock = false;
                            if (i != this.resizeDivider) {
                                this.trackDivider.set(i, (this.tempDivider.get(i) / preresize) * mouseY);
                            }
                        }
                    }
                }
                if ((this.trackDivider.get(0) * this.getHeight()) >= 20) {
                    this.trackDivider.set(0, (this.tempDivider.get(0) / preresize) * mouseY);
                    positivelock = false;
                } else {
                    this.trackDivider.set(0, 19 / (double) this.getHeight());
                }

            } else {

                negative = false;
                negativelock = true;
                if (this.resizeDivider < this.trackDivider.size() - 1) {

                    for (int i = this.resizeDivider; i < this.trackDivider.size() - 1; i++) {

                        if ((this.trackDivider.get(i + 1) * this.getHeight())
                                - (this.trackDivider.get(i) * this.getHeight()) < 20) {

                            this.trackDivider.set(i, ((this.trackDivider.get(i + 1) * this.getHeight()) - 19)
                                    / (double) this.getHeight());
                        } else {

                            negativelock = false;
                            if (i != this.resizeDivider) {
                                try {
                                    this.trackDivider.set(i,
                                            1 - ((1 - this.tempDivider.get(i)) / (this.getHeight() - preresize))
                                                    * (this.getHeight() - mouseY));
                                } catch (Exception e) {

                                    //   e.printStackTrace();
                                }
                            }
                        }
                    }
                    if (this.getHeight()
                            - (this.trackDivider.get(this.trackDivider.size() - 2) * this.getHeight()) >= 20) {
                        negativelock = false;
                    } else {
                        this.trackDivider.set(this.trackDivider.size() - 2,
                                (this.getHeight() - 19) / (double) this.getHeight());
                    }

                }
            }

            preresizer = this.trackDivider.get(this.resizeDivider) * this.getHeight();
            repaint();

        } else if (lineZoomer) {

            if (Main.drawCanvas.selectedSplit.start > 1
                    || Main.drawCanvas.selectedSplit.end < Main.drawCanvas.selectedSplit.chromEnd) {
                Main.drawCanvas.gotoPos(
                        Main.drawCanvas.selectedSplit.start
                                - (Main.drawCanvas.tempDrag - mouseX) / Main.drawCanvas.selectedSplit.pixel * 2,
                        Main.drawCanvas.selectedSplit.end + (Main.drawCanvas.tempDrag - mouseX)
                                / Main.drawCanvas.selectedSplit.pixel * 2);
            }

            Main.drawCanvas.tempDrag = mouseX;
            Main.chromDraw.updateExons = true;
            repaint();
            Main.chromDraw.repaint();
            Draw.updatevars = true;
            Main.drawCanvas.repaint();

        } else {
            if (getCursor().getType() != Cursor.N_RESIZE_CURSOR) {
                zoomDrag = true;

                repaint();
            }
            return;
        }
        break;
    }
    case InputEvent.BUTTON3_MASK: {
        if (sidebar) {
            return;
        }
        if ((int) Main.drawCanvas.selectedSplit.start == 1
                && (int) Main.drawCanvas.selectedSplit.end == Main.drawCanvas.selectedSplit.chromEnd) {
            break;
        }

        Main.drawCanvas.mouseDrag = true;
        Main.drawCanvas.moveX = event.getX();
        Main.drawCanvas.drag(Main.drawCanvas.moveX);
        break;
    }
    case 17: {
        if (sidebar) {
            return;
        }
        if ((int) Main.drawCanvas.selectedSplit.start == 1
                && (int) Main.drawCanvas.selectedSplit.end == Main.drawCanvas.selectedSplit.chromEnd) {
            break;
        }

        Main.drawCanvas.mouseDrag = true;
        Main.drawCanvas.moveX = event.getX();
        Main.drawCanvas.drag(Main.drawCanvas.moveX);
        break;
    }
    }
}

From source file:org.pentaho.reporting.designer.core.editor.report.AbstractRenderComponent.java

protected void updateCursorForIndicator() {
    if (currentIndicator == null) {
        setCursor(Cursor.getDefaultCursor());
        return;// w  w  w . j a  va  2 s  .  com
    }
    switch (currentIndicator) {
    case NOT_IN_RANGE:
        setCursor(Cursor.getDefaultCursor());
        break;
    case MOVE:
        setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
        break;
    case BOTTOM_CENTER:
        setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
        break;
    case BOTTOM_LEFT:
        setCursor(Cursor.getPredefinedCursor(Cursor.SW_RESIZE_CURSOR));
        break;
    case BOTTOM_RIGHT:
        setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
        break;
    case MIDDLE_LEFT:
        setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
        break;
    case MIDDLE_RIGHT:
        setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
        break;
    case TOP_LEFT:
        setCursor(Cursor.getPredefinedCursor(Cursor.NW_RESIZE_CURSOR));
        break;
    case TOP_CENTER:
        setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
        break;
    case TOP_RIGHT:
        setCursor(Cursor.getPredefinedCursor(Cursor.NE_RESIZE_CURSOR));
        break;
    }
}