Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to set cursor (Read 5147 times)
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
how to set cursor
Apr 3rd, 2012 at 8:00pm
Print Post  
Maybe a simple question, (me being a newby at java:)

I Try this:
DiagramView1.getDiagramView().setPointerCursor(3 );
or
DiagramView1.getDiagramView().setPointerCursor("Cursor Wait" );

But it doesn't work.
How to declare/construct a java.aws.cursor?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to set cursor
Reply #1 - Apr 4th, 2012 at 5:47am
Print Post  
Are you trying to set it for a DiagramApplet from JavaScript?
  
Back to top
 
IP Logged
 
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
Re: how to set cursor
Reply #2 - Apr 4th, 2012 at 2:18pm
Print Post  
yes, i'm using the java-applet in an asp.net page.
I want to change the cursor dynamically on some client-events
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to set cursor
Reply #3 - Apr 4th, 2012 at 4:59pm
Print Post  
Try this code:

Code
Select All
var diagView = applet.getDiagramView();
var cursor = diagView.getPointerCursor();
diagView.setPointerCursor(cursor.getPredefinedCursor(7));
 



You can find the constants from java.awt.Cursor copied below. You might also check the getSystemCustomCursor method. I'm not sure how it's supposed to be used though.

I hope that helps,
Stoyan

    /**
     * The default cursor type (gets set if no cursor is defined).
     */
    public static final int      DEFAULT_CURSOR              = 0;

    /**
     * The crosshair cursor type.
     */
    public static final int      CROSSHAIR_CURSOR            = 1;

    /**
     * The text cursor type.
     */
    public static final int      TEXT_CURSOR                  = 2;

    /**
     * The wait cursor type.
     */
    public static final int      WAIT_CURSOR                  = 3;

    /**
     * The south-west-resize cursor type.
     */
    public static final int      SW_RESIZE_CURSOR            = 4;

    /**
     * The south-east-resize cursor type.
     */
    public static final int      SE_RESIZE_CURSOR            = 5;

    /**
     * The north-west-resize cursor type.
     */
    public static final int      NW_RESIZE_CURSOR            = 6;

    /**
     * The north-east-resize cursor type.
     */
    public static final int      NE_RESIZE_CURSOR            = 7;

    /**
     * The north-resize cursor type.
     */
    public static final int      N_RESIZE_CURSOR            = 8;

    /**
     * The south-resize cursor type.
     */
    public static final int      S_RESIZE_CURSOR            = 9;

    /**
     * The west-resize cursor type.
     */
    public static final int      W_RESIZE_CURSOR                  = 10;

    /**
     * The east-resize cursor type.
     */
    public static final int      E_RESIZE_CURSOR                  = 11;

    /**
     * The hand cursor type.
     */
    public static final int      HAND_CURSOR                  = 12;

    /**
     * The move cursor type.
     */
    public static final int      MOVE_CURSOR                  = 13;
  
Back to top
 
IP Logged
 
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
Re: how to set cursor
Reply #4 - Apr 4th, 2012 at 6:05pm
Print Post  
This works fine.
Thanks a lot
hans,
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint