类java.awt.Cursor源码实例Demo

下面列出了怎么用java.awt.Cursor的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: uima-uimaj   文件: DocumentAnalyzer.java
/**
 * Collection process complete.
 *
 * @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#collectionProcessComplete()
 */
@Override
public void collectionProcessComplete() {
  // invoke ProcessingCompleteRunnable in Swing event handler thread
  // SwingUtilities.invokeLater(new ProcessingCompleteRunnable());
  // hide progress bar dialog if it is visible
  if (!progressMonitor.isCanceled()) {
    progressMonitor.close();
    progressTimer.stop();
  }

  // Re-enable frame:
  setEnabled(true);

  // reset cursor
  setCursor(Cursor.getDefaultCursor());

  // if everything works, output performance stats and print them to a
  // pane. Allow users to open generated files.
  showAnalysisResults(new AnalysisEnginePerformanceReports(mCPM.getPerformanceReport()),
          outputDirectory);
}
 
源代码2 项目: importer-exporter   文件: DatePicker.java
private JPanel createLinkPanel() {
    linkPanel = new JPanel();
    linkPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));

    todayLink = new JLabel();
    todayLink.setForeground(new Color(16, 66, 104));
    todayLink.setCursor(new Cursor(Cursor.HAND_CURSOR));
    linkPanel.add(todayLink);

    todayLink.addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            if (SwingUtilities.isLeftMouseButton(e)) {
                Action delegate = getActionMap().get(e.getClickCount() != 2 ? JXDatePicker.HOME_NAVIGATE_KEY : JXDatePicker.HOME_COMMIT_KEY);
                if (delegate != null && delegate.isEnabled())
                    delegate.actionPerformed(null);
            }
        }
    });

    return linkPanel;
}
 
源代码3 项目: openjdk-8   文件: RangeSlider.java
public void mouseMoved(MouseEvent e) {
    isOverBar = false;
    if (model == null) {
        return;
    }


    Point p = e.getPoint();
    if (isOverFirstPosition(p) || isOverSecondPosition(p)) {
        setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
    } else if (isOverSelection(p)) {
        isOverBar = true;
        setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    } else {
        this.setCursor(Cursor.getDefaultCursor());
    }
    repaint();
}
 
源代码4 项目: ET_Redux   文件: MaskingShade.java
/**
 *
 * @param e
 */
@Override
public void mouseDragged(MouseEvent e) {

    if (mouseIsPressedInPullTab) {
        currentMouseX = e.getX();
        currentMouseY = e.getY();

        if (pullFrom == PULL_FROM_LEFT) {
            setShadeCover(Math.max(WIDTH_OF_PULLTAB, getWidth() + (currentMouseX - pressedMouseX)));
            pressedMouseX = currentMouseX;
        } else {
            setShadeCover(Math.max(WIDTH_OF_PULLTAB, getWidth() + (pressedMouseX - currentMouseX)));
            pressedMouseX = WIDTH_OF_PULLTAB / 2;
        }

        if (!mouseInPullTab()) {
            processMouseExitedPullTab();
            setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
        }
    }
}
 
源代码5 项目: ET_Redux   文件: WeightedMeanGraphPanel.java
/**
     * Creates a new instance of WeightedMeanGraphPanel
     *
     * @param sample
     */
    public WeightedMeanGraphPanel(SampleInterface sample) {
        super();

        this.sample = sample;

        setOpaque(true);

        setBackground(Color.white);

        graphWidth = 775;
        graphHeight = 600;

        selectedSampleDateModels = new Object[0][0];

        weightedMeanCursor = Cursor.getDefaultCursor();
        imageMode = "PAN";
//        setInRandomMode( false );
        weightedMeanOptions = new SampleDateInterpretationGUIOptions().getWeightedMeanOptions();

        addMouseListener(this);
        addMouseMotionListener(this);
    }
 
源代码6 项目: wildfly-core   文件: CommandExecutor.java
private OperationResponse execute(ModelNode request, boolean useWaitCursor) throws IOException {

        if(request.get(Util.OPERATION).asString().equals(Util.COMPOSITE) &&
                (!request.get(Util.STEPS).isDefined() || request.get(Util.STEPS).asList().isEmpty())) {
            return OperationResponse.Factory.createSimple(new ModelNode("WARN: no request was sent as there were no server-side operations to execute"));
        }

        try {
            if (useWaitCursor) {
                cliGuiCtx.getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            }
            return client.get().executeOperation(OperationBuilder.create(request).build(), OperationMessageHandler.DISCARD);
        } finally {
            if (useWaitCursor) {
                cliGuiCtx.getMainWindow().setCursor(Cursor.getDefaultCursor());
            }
        }
    }
 
源代码7 项目: javagame   文件: DQC.java
/**
 * �t���X�N���[�����[�h�̏�����
 * 
 */
private void initFullScreen() {
    GraphicsEnvironment env = GraphicsEnvironment
            .getLocalGraphicsEnvironment();
    device = env.getDefaultScreenDevice();

    // �^�C�g���o�[������
    setUndecorated(true);
    // �}�E�X�J�[�\��������
    Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
            new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB),
            new Point(), "");
    setCursor(cursor);

    if (!device.isFullScreenSupported()) {
        System.out.println("�t���X�N���[�����[�h�̓T�|�[�g����Ă��܂���B");
        System.exit(0);
    }

    device.setFullScreenWindow(this); // �t���X�N���[�����I

    DisplayMode mode = new DisplayMode(640, 480, 16,
            DisplayMode.REFRESH_RATE_UNKNOWN);
    device.setDisplayMode(mode);
}
 
源代码8 项目: megamek   文件: BoardEditor.java
/**
 * Saves the board in PNG image format.
 */
private void boardSaveImage(boolean ignoreUnits) {
    if (curfileImage == null) {
        boardSaveAsImage(ignoreUnits);
        return;
    }
    JDialog waitD = new JDialog(frame, Messages.getString("BoardEditor.waitDialog.title")); //$NON-NLS-1$
    waitD.add(new JLabel(Messages.getString("BoardEditor.waitDialog.message"))); //$NON-NLS-1$
    waitD.setSize(250, 130);
    // move to middle of screen
    waitD.setLocation(
            (frame.getSize().width / 2) - (waitD.getSize().width / 2),
            (frame.getSize().height / 2) - (waitD.getSize().height / 2));
    waitD.setVisible(true);
    frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    waitD.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    // save!
    try {
        ImageIO.write(bv.getEntireBoardImage(ignoreUnits), "png", curfileImage);
    } catch (IOException e) {
        e.printStackTrace();
    }
    waitD.setVisible(false);
    frame.setCursor(Cursor.getDefaultCursor());
}
 
源代码9 项目: jdk8u_jdk   文件: XComponentPeer.java
public void pSetCursor(Cursor cursor, boolean ignoreSubComponents) {
    XToolkit.awtLock();
    try {
        long xcursor = XGlobalCursorManager.getCursor(cursor);

        XSetWindowAttributes xwa = new XSetWindowAttributes();
        xwa.set_cursor(xcursor);

        long valuemask = XConstants.CWCursor;

        XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),getWindow(),valuemask,xwa.pData);
        XlibWrapper.XFlush(XToolkit.getDisplay());
        xwa.dispose();
    } finally {
        XToolkit.awtUnlock();
    }
}
 
源代码10 项目: ET_Redux   文件: EvolutionPlotPanel.java
/**
 *
 * @param evt
 */
@Override
public void mouseMoved(MouseEvent evt) {
    int myX = evt.getX();
    int myY = evt.getY();

    eastResizing = isEastResize(myX);
    southResizing = isSouthResize(myY);

    setCursor(Cursor.getDefaultCursor());
    if (eastResizing ^ southResizing) {
        if (eastResizing) {
            setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
        } else {
            setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
        }
    }

    if (eastResizing && southResizing) {
        setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
    }
}
 
源代码11 项目: tn5250j   文件: TN5250jSplashScreen.java
/**
 * This method will show or hide the splash screen.  Once the splash
 * screen is hidden, the splash screen window will be disposed. This means
 * the splash screen cannot become visible again.
 */
public void setVisible(boolean show) {
   if (show == true && dialog != null && f != null && !dialog.isVisible()) {
      dialog.setVisible(true);
   }
   else {

      if (dialog != null) {
         updateProgress(steps + 1);
         dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
         dialog.dispose();
      }
      if (f != null) {
         f.dispose();
      }
      dialog = null;
      f = null;
   }
}
 
源代码12 项目: TencentKona-8   文件: RangeSlider.java
public void mouseMoved(MouseEvent e) {
    isOverBar = false;
    if (model == null) {
        return;
    }


    Point p = e.getPoint();
    if (isOverFirstPosition(p) || isOverSecondPosition(p)) {
        setCursor(Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR));
    } else if (isOverSelection(p)) {
        isOverBar = true;
        setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    } else {
        this.setCursor(Cursor.getDefaultCursor());
    }
    repaint();
}
 
源代码13 项目: TencentKona-8   文件: XComponentPeer.java
public void pSetCursor(Cursor cursor, boolean ignoreSubComponents) {
    XToolkit.awtLock();
    try {
        long xcursor = XGlobalCursorManager.getCursor(cursor);

        XSetWindowAttributes xwa = new XSetWindowAttributes();
        xwa.set_cursor(xcursor);

        long valuemask = XConstants.CWCursor;

        XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),getWindow(),valuemask,xwa.pData);
        XlibWrapper.XFlush(XToolkit.getDisplay());
        xwa.dispose();
    } finally {
        XToolkit.awtUnlock();
    }
}
 
源代码14 项目: audiveris   文件: Rubber.java
private void setCursor (MouseEvent e)
{
    if (isDragWanted(e)) {
        e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
    } else if (isAdditionWanted(e)) {
        e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    } else if (isContextWanted(e)) {
        e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    } else if (isRubberWanted(e)) {
        e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
    } else if (isRezoomWanted(e)) {
        e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
    } else {
        e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    }
}
 
/**
 *
 * @param sampleSessionDataView
 * @param dataPresentationMode
 * @param timeArray
 * @param bounds
 * @param meanOnly the value of meanOnly
 */
public DataPresentationModeChooserPanel(//
        JLayeredPane sampleSessionDataView, //
        DataPresentationModeEnum dataPresentationMode, //
        double[] timeArray, //
        Rectangle bounds, //
        boolean meanOnly) {

    super(bounds);

    this.sampleSessionDataView = sampleSessionDataView;

    this.dataPresentationMode = dataPresentationMode;

    this.myOnPeakNormalizedAquireTimes = timeArray;
    this.meanOnly = meanOnly;

    setOpaque(true);
    setBackground(new Color(250, 240, 230));
    setCursor(Cursor.getDefaultCursor());

    dataViewModeButtonGroup = new ButtonGroup();
}
 
源代码16 项目: jdk8u-jdk   文件: XDragSourceContextPeer.java
protected void setNativeCursor(long nativeCtxt, Cursor c, int cType) {
    assert XToolkit.isAWTLockHeldByCurrentThread();

    if (c == null) {
        return;
    }

    long xcursor = XGlobalCursorManager.getCursor(c);

    if (xcursor == 0) {
        return;
    }

    XlibWrapper.XChangeActivePointerGrab(XToolkit.getDisplay(),
                                         GRAB_EVENT_MASK,
                                         xcursor,
                                         XConstants.CurrentTime);
}
 
源代码17 项目: MobyDroid   文件: JPanel_FileBrowser.java
/**
 * Disable the User Interface.
 */
public void disableUI() {
    // turn on the wait cursor
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    // hide jTable (disabling show out of bound exception ! ! !)
    jTable_Browser.setVisible(false);
    // disable input
    jComboBox_Path.setEnabled(false);
    jTextField_Filter.setEnabled(false);
    // disable buttons
    mButton_Copy.setEnabled(false);
    mButton_Delete.setEnabled(false);
    mButton_GoUp.setEnabled(false);
    mButton_MakeDirectory.setEnabled(false);
    mButton_MakeFile.setEnabled(false);
    mButton_Paste.setEnabled(false);
    mButton_Refresh.setEnabled(false);
    mButton_Rename.setEnabled(false);
}
 
源代码18 项目: MeteoInfo   文件: FrmMain.java
/**
 * Load an application
 *
 * @param plugin Application
 */
public void loadApplication(Application plugin) {
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    try {
        PythonInterpreter interp = this.getConsoleDockable().getInterpreter();
        String path = plugin.getPath();
        interp.exec("import " + path);
        interp.exec("from " + path + ".loadApp import LoadApp");
        PyObject loadClass = interp.get("LoadApp");
        PyObject loadObj = loadClass.__call__();
        IPlugin instance = (IPlugin) loadObj.__tojava__(IPlugin.class);
        instance.setApplication(FrmMain.this);
        instance.setName(plugin.getName());
        plugin.setPluginObject(instance);
        plugin.setLoad(true);
        instance.load();
    } catch (Exception e) {
        e.printStackTrace();
    }
    this.setCursor(Cursor.getDefaultCursor());
}
 
源代码19 项目: knopflerfish.org   文件: StatusBar.java
public void stopProgress() {
  stopRunner();

  updateProgress(0);
  perc = 0;
  msg  = "";
  repaint();

  setCursor(Cursor.DEFAULT_CURSOR);
}
 
源代码20 项目: sc2gears   文件: BrowserDialog.java
/**
 * Completes the initialization of the dialog.
 * @param url           URL of the page to be displayed
 * @param preferredSize optional preferred size of the browser component
 */
private void completeInit( final String url, final Dimension preferredSize ) {
	final JEditorPane browserPane = GuiUtils.createEditorPane();
	browserPane.setPreferredSize( preferredSize );
	final JScrollPane scrollPane = new JScrollPane( browserPane );
	scrollPane.setBorder( BorderFactory.createEmptyBorder( 10, 10, 10, 10 ) );
	getContentPane().add( scrollPane, BorderLayout.CENTER );
	
	final JButton okButton = createCloseButton( "button.close" );
	getContentPane().add( GuiUtils.wrapInPanel( okButton ), BorderLayout.SOUTH );
	
	// Load page content in a new thread to not block the AWT event dispatcher thread
	new NormalThread( "Browser dialog content loader" ) {
		@Override
           public void run() {
			try {
				browserPane.setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) );
		        browserPane.setPage( url );
	        } catch ( final IOException ie ) {
		        ie.printStackTrace();
		        browserPane.setContentType( "text/html" );
		        browserPane.setText( "<html><body style='font-family:arial;font-size:10px;font-style:italic;background:#ffffff;'>"
						+ "<p>This content is currently unavailable. Please try again later.</p></body></html>" );
	        } finally {
				browserPane.setCursor( null );
	        }
           }
	}.start();
	
	packAndShow( okButton, false );
}
 
源代码21 项目: netbeans   文件: NewConnectionPanel.java
public void setWaitingState(boolean wait) {
    Component rootPane = getRootPane();
    enableInput(! wait);
    if (rootPane != null) {
        rootPane.setCursor(wait ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null);
    }
}
 
源代码22 项目: spotbugs   文件: MainFrame.java
void updateProjectAndBugCollection(BugCollection bugCollection) {

        if (bugCollection != null) {
            displayer.clearCache();
            BugSet bs = new BugSet(bugCollection);
            // Don't clear data, the data's correct, just get the tree off the
            // listener lists.
            BugTreeModel model = (BugTreeModel) mainFrameTree.getTree().getModel();
            model.getOffListenerList();
            model.changeSet(bs);
            // curProject=BugLoader.getLoadedProject();
            setProjectChanged(true);
        }
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
    }
 
源代码23 项目: nordpos   文件: JRViewer.java
public void mouseMoved(MouseEvent e)
{
	JRPrintImageAreaHyperlink imageArea = getImageMapArea(e);
	if (imageArea != null
			&& imageArea.getHyperlink().getHyperlinkTypeValue() != HyperlinkTypeEnum.NONE)
	{
		e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
	}
	else
	{
		e.getComponent().setCursor(Cursor.getDefaultCursor());
	}
}
 
源代码24 项目: netbeans   文件: TooltipWindow.java
public void mouseMoved(MouseEvent e) {
    if (e.getSource().equals(textPane)) {
        textPane.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        linkerSupport.computeBounds(textPane, 0);
        linkerSupport.mouseMoved(e.getPoint(), textPane, messageOffset);
    }
    textPane.setToolTipText("");  // NOI18N
}
 
源代码25 项目: stendhal   文件: CursorRepository.java
public Cursor get(StendhalCursor stendhalCursor) {
	Cursor res = cursorMap.get(stendhalCursor);
	if (res == null) {
		res = loadCursor(stendhalCursor);
	}
	return res;
}
 
源代码26 项目: ET_Redux   文件: YAxisView.java
/**
 *
 *
 * @param rawDataModelViews
 * @param sampleSessionDataView
 * @param backgroundColor
 * @param minY
 * @param maxY
 * @param bounds
 * @param floating
 * @param forStandards the value of forStandards
 */
public YAxisView(//
        AbstractRawDataView[] rawDataModelViews, //
        JLayeredPane sampleSessionDataView, //
        Color backgroundColor, //
        double minY, //
        double maxY, //
        Rectangle bounds, //
        boolean floating, //
        boolean forStandards) {
    super(bounds);

    this.rawDataModelViews = rawDataModelViews;
    this.dataViewsOverlay = null;
    this.sampleSessionDataView = sampleSessionDataView;
    this.backgroundColor = backgroundColor;
    this.yOnMousePress = 0;
    this.minY = minY;
    this.maxY = maxY;
    this.floating = floating;
    this.forStandards = forStandards;

    // horizontal layout arbitrarily fixed
    this.minX = 0;
    this.maxX = bounds.getWidth();//100;

    setOpaque(true);
    setBackground(Color.white);

    setBounds(bounds);
    graphWidth = bounds.width - leftMargin;
    graphHeight = bounds.height - topMargin;

    addMeAsMouseListener();
    addMeAsMouseMotionListener();

    setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
 
源代码27 项目: Course_Generator   文件: frmMain.java
/**
 * Save the selected data to disk in CGX format
 */
private void SavePartCGX() {
	String s;

	if (Track.data.isEmpty())
		return;

	s = Utils.SaveDialog(this, Settings.previousCGXDirectory, "", ".cgx", bundle.getString("frmMain.CGXFile"), true,
			bundle.getString("frmMain.FileExist"));

	if (!s.isEmpty()) {
		setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

		// -- Save track
		int start = panelTrackData.getSelectedRow();
		int end = start + panelTrackData.getSelectedRowCount() - 1;

		Track.SaveCGX(s, start, end, false);
		// -- Store the directory
		Settings.previousCGXDirectory = Utils.GetDirFromFilename(s);

		// -- Update GPX MRU
		AddMruCGX(s);
		RefreshMruCGX();

		// -- We don't reset the track modified flag because we save only a
		// part of the track!
		Track.isModified = false;

		// -- Refresh info panel
		RefreshStatusbar(Track);

		setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
	}
}
 
源代码28 项目: WhiteRabbit   文件: RabbitInAHatMain.java
private void doGenerateEtlHtmlDoc() {
	String directoryName = chooseSaveDirectory();
	if (directoryName != null) {
		frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
		ETLMarkupDocumentGenerator generator = new ETLMarkupDocumentGenerator(ObjectExchange.etl);
		generator.generate(directoryName, DocumentType.HTML);
		frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
	}
}
 
源代码29 项目: netbeans   文件: MultiSplitPane.java
@Override
public void mouseReleased(MouseEvent e) {
    if( null == draggingDivider )
        return;
    
    final Point p = new Point( e.getPoint() );
    draggingDivider.finishDraggingTo( p );
    draggingDivider = null;
    setCursor( Cursor.getDefaultCursor() );
    e.consume();
}
 
源代码30 项目: openjdk-jdk9   文件: GetSystemCustomCursor.java
public static void main(final String[] args) throws AWTException {
    // This list is copied from cursors.properties
    String[] names = {"CopyDrop.32x32", "MoveDrop.32x32", "LinkDrop.32x32",
                      "CopyNoDrop.32x32", "MoveNoDrop.32x32",
                      "LinkNoDrop.32x32", "Invalid.32x32"};
    for (final String name : names) {
        if (Cursor.getSystemCustomCursor(name) == null) {
            throw new RuntimeException("Cursor is null: " + name);
        }
    }
    System.out.println("Test passed");
}
 
 类所在包
 同包方法