use of java.awt.Cursor in project jabref by JabRef.
the class HelpAction method getHelpLabel.
public JLabel getHelpLabel(String labelText) {
JLabel helpLabel = new JLabel("<html><u>" + labelText + "</u></html>");
helpLabel.setForeground(Color.BLUE);
helpLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
helpLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
openHelpPage();
}
});
return helpLabel;
}
use of java.awt.Cursor in project darkFunction-Editor by darkFunction.
the class SpriteTree method dragGestureRecognized.
public void dragGestureRecognized(DragGestureEvent e) {
CustomNode dragNode = (CustomNode) getSelectedNode();
if (dragNode != null) {
String nodeString = (String) dragNode.getFullPathName();
StringSelection transferable = new StringSelection(nodeString);
Cursor cursor = DragSource.DefaultCopyNoDrop;
dragSource.startDrag(e, cursor, transferable, this);
//System.out.println("Dragging node: " + nodeString);
}
}
use of java.awt.Cursor in project gephi by gephi.
the class TimelineDrawer method mouseMoved.
@Override
public void mouseMoved(MouseEvent evt) {
if (model == null) {
return;
}
//System.out.println("mouse moved");
currentMousePositionX = evt.getX();
int x = currentMousePositionX;
int width = getWidth();
int r = settings.selection.visibleHookWidth;
double min = model.getCustomMin();
double max = model.getCustomMax();
double intervalStart = model.getIntervalStart();
double intervalEnd = model.getIntervalEnd();
int sf = Math.max(0, getPixelPosition(intervalStart, max - min, min, width));
int st = Math.min(width, getPixelPosition(intervalEnd, max - min, min, width));
//Tooltip
double pos = getReal(currentMousePositionX, max - min, min, width);
tooltip.setModel(model);
tooltip.start(pos, evt.getLocationOnScreen(), this);
// SELECTED ZONE BEGIN POSITION, IN PIXELS
// int sf = (int) (model.getFromFloat() * (double) w);
// SELECTED ZONE END POSITION, IN PIXELS
//int st = (int) (model.getToFloat() * (double) w);
HighlightedComponent old = highlightedComponent;
Cursor newCursor = null;
//settings.selection.invisibleHookMargin;
int a = 0;
int position = inPosition(x, r, sf, st);
switch(position) {
case LOC_RESIZE_FROM:
newCursor = CURSOR_LEFT_HOOK;
highlightedComponent = HighlightedComponent.LEFT_HOOK;
break;
case LOC_RESIZE_CENTER:
highlightedComponent = HighlightedComponent.CENTER_HOOK;
newCursor = CURSOR_CENTRAL_HOOK;
break;
case LOC_RESIZE_TO:
highlightedComponent = HighlightedComponent.RIGHT_HOOK;
newCursor = CURSOR_RIGHT_HOOK;
break;
default:
highlightedComponent = HighlightedComponent.NONE;
newCursor = CURSOR_DEFAULT;
break;
}
if (newCursor != getCursor()) {
setCursor(newCursor);
}
// only repaint if highlight has changed (save a lot of fps)
if (highlightedComponent != old) {
repaint();
}
// now we always repaint, because of the tooltip
// repaint();
}
use of java.awt.Cursor in project sonarqube by SonarSource.
the class ScannerReportViewerApp method initialize.
/**
* Initialize the contents of the frame.
*/
private void initialize() {
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (Exception e) {
// If Nimbus is not available, you can set the GUI to another look and feel.
}
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
splitPane = new JSplitPane();
frame.getContentPane().add(splitPane, BorderLayout.CENTER);
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
tabbedPane.setPreferredSize(new Dimension(500, 7));
splitPane.setRightComponent(tabbedPane);
componentDetailsTab = new JScrollPane();
tabbedPane.addTab("Component details", null, componentDetailsTab, null);
componentEditor = new JEditorPane();
componentDetailsTab.setViewportView(componentEditor);
sourceTab = new JScrollPane();
tabbedPane.addTab("Source", null, sourceTab, null);
sourceEditor = createSourceEditor();
sourceEditor.setEditable(false);
sourceTab.setViewportView(sourceEditor);
textLineNumber = createTextLineNumber();
sourceTab.setRowHeaderView(textLineNumber);
highlightingTab = new JScrollPane();
tabbedPane.addTab("Highlighting", null, highlightingTab, null);
highlightingEditor = new JEditorPane();
highlightingTab.setViewportView(highlightingEditor);
symbolTab = new JScrollPane();
tabbedPane.addTab("Symbol references", null, symbolTab, null);
symbolEditor = new JEditorPane();
symbolTab.setViewportView(symbolEditor);
coverageTab = new JScrollPane();
tabbedPane.addTab("Coverage", null, coverageTab, null);
coverageEditor = new JEditorPane();
coverageTab.setViewportView(coverageEditor);
duplicationTab = new JScrollPane();
tabbedPane.addTab("Duplications", null, duplicationTab, null);
duplicationEditor = new JEditorPane();
duplicationTab.setViewportView(duplicationEditor);
testsTab = new JScrollPane();
tabbedPane.addTab("Tests", null, testsTab, null);
testsEditor = new JEditorPane();
testsTab.setViewportView(testsEditor);
issuesTab = new JScrollPane();
tabbedPane.addTab("Issues", null, issuesTab, null);
issuesEditor = new JEditorPane();
issuesTab.setViewportView(issuesEditor);
measuresTab = new JScrollPane();
tabbedPane.addTab("Measures", null, measuresTab, null);
measuresEditor = new JEditorPane();
measuresTab.setViewportView(measuresEditor);
scmTab = new JScrollPane();
tabbedPane.addTab("SCM", null, scmTab, null);
scmEditor = new JEditorPane();
scmTab.setViewportView(scmEditor);
treeScrollPane = new JScrollPane();
treeScrollPane.setPreferredSize(new Dimension(200, 400));
splitPane.setLeftComponent(treeScrollPane);
componentTree = new JTree();
componentTree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("empty") {
{
}
}));
treeScrollPane.setViewportView(componentTree);
componentTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
componentTree.addTreeSelectionListener(new TreeSelectionListener() {
@Override
public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) componentTree.getLastSelectedPathComponent();
if (node == null) {
// Nothing is selected.
return;
}
frame.setCursor(new Cursor(Cursor.WAIT_CURSOR));
updateDetails((Component) node.getUserObject());
frame.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
});
frame.pack();
}
use of java.awt.Cursor in project screenbird by adamhub.
the class RecorderPanel method showVideoURL.
/**
* Displays the screenbird URL on the upload form.
*/
private void showVideoURL() {
this.txtUrl.setText(Session.getInstance().user.getBaseURL() + this.outputMovieSlug);
this.txtUrl.setCursor(new Cursor(Cursor.HAND_CURSOR));
this.txtUrl.addMouseListener(uploadUrlListener);
this.txtUrl.setVisible(true);
this.jLabel2.setVisible(true);
this.btnCopy.setVisible(true);
this.btnCopy.setEnabled(true);
((JFrame) this.getParent().getParent().getParent().getParent()).pack();
this.redrawWindow();
}
Aggregations