项目:incubator-netbeans
文件:NotificationImpl.java
private JComponent createDetails(String text,ActionListener action) {
try {
text = (action == null ? "<html>" : "<html><a href=\"_blank\">") + XMLUtil.toElementContent(text); //NOI18N
} catch (CharConversionException ex) {
throw new IllegalArgumentException(ex);
}
if (null == action) {
return new JLabel(text);
}
JButton btn = new JButton(text);
btn.setFocusable(false);
btn.setBorder(BorderFactory.createEmptyBorder());
btn.setBorderPainted(false);
btn.setFocusPainted(false);
btn.setopaque(false);
btn.setContentAreaFilled(false);
btn.addActionListener(action);
btn.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
Color c = UIManager.getColor("nb.html.link.foreground"); //NOI18N
if (c != null) {
btn.setForeground(c);
}
return btn;
}
项目: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();
}
}
项目:incubator-netbeans
文件:ProfilingPointsWindowUI.java
private void dispatchResultsRendererEvent(MouseEvent e) {
int column = profilingPointsTable.columnAtPoint(e.getPoint());
if (column != 3) {
// if (column != 2) { // Todo: revert to 3 once Scope is enabled
profilingPointsTable.setCursor(Cursor.getDefaultCursor()); // Workaround for forgotten Hand cursor from HTML renderer,Todo: fix it!
return;
}
int row = profilingPointsTable.rowAtPoint(e.getPoint());
if (row == -1) {
return;
}
ProfilingPoint profilingPoint = getProfilingPointAt(row);
ProfilingPoint.ResultsRenderer resultsRenderer = profilingPoint.getResultsRenderer();
Rectangle cellRect = profilingPointsTable.getCellRect(row,column,true);
resultsRenderer.dispatchMouseEvent(e,cellRect);
}
项目:geomapapp
文件:PDBDataSetGraph.java
public int closestSide(Point p,XYGraph xyg) {
int n=0;
double dist = 5/xScale;
double dist2 = Math.abs(xyg.getXAt(p) - minX+.03*(maxX-minX));
if (dist2 < dist) {dist = dist2; n = -1;}
dist2 = Math.abs(xyg.getXAt(p) - maxX-.03*(maxX-minX));
if (dist2 < dist) {dist = dist2; n = -2;}
dist = 5/yScale;
dist2 = Math.abs(xyg.getYAt(p) - minY+.03*(maxY-minY));
if (dist2 < dist) {dist = dist2; n = 1;}
dist2 = Math.abs(xyg.getYAt(p) - maxY-.03*(maxY-minY));
if (dist2 < dist) {dist = dist2; n = 2;}
if (side!=0&&n==0)
if (lassoButton!=null && lassoButton.isSelected())
xyg.setCursor(Cursors.getCursor(Cursors.LASSO));
else
xyg.setCursor(Cursor.getDefaultCursor());
return n;
}
项目:Panako
文件:StreamLayer.java
@Override
public void mouseMoved(MouseEvent e) {
if(graphics!=null){
float spacer = LayerUtilities.pixelsToUnits(graphics,20,false);
float heightOfABlock = LayerUtilities.pixelsToUnits(graphics,30,false);
int verticalOffsetoffset = -1 * (Math.round((index + 1) * spacer + index * heightOfABlock));
int startHeight = verticalOffsetoffset ;
int stopHeight = verticalOffsetoffset + Math.round(heightOfABlock);
Point2D pointInUnits = LayerUtilities.pixelsToUnits(graphics,e.getX(),e.getY());
int startTime = Math.round(guessedStartTimeOfStream);
int stopTime = Math.round(guessedStartTimeOfStream+streamDuration);
if(pointInUnits.getX() >= startTime && pointInUnits.getX() <= stopTime && pointInUnits.getY() >= startHeight && pointInUnits.getY() <= stopHeight){
((JComponent)(e.getSource())).setCursor(new Cursor(Cursor.HAND_CURSOR));
e.consume();
}
}
}
项目:jmt
文件:Convex2DGraph.java
public void mousepressed(MouseEvent e) {
dragging = false;
mouseButtonPress = e.getButton();
// If the cursor is on a point and the left button is press
// the point is select
if (e.getButton() == 1) {
// Select the dominant
if (selectedPoint != null) {
selectedPoint.setSelect(true);
setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
dragging = true;
} else {
filterStartPoint = adjustMousePoint(e.getPoint());
filterEndPoint = filterStartPoint;
filtering = true;
}
} else if (e.getButton() == 3) {
filterStartPoint = adjustMousePoint(e.getPoint());
filterEndPoint = filterStartPoint;
unFiltering = true;
}
repaint();
}
项目:incubator-netbeans
文件:Utils.java
/**
* Switches the wait cursor on the NetBeans glasspane of/on
*
* @param on
*/
public static void setWaitCursor(final boolean on) {
Runnable r = new Runnable() {
@Override
public void run() {
JFrame mainWindow = (JFrame) WindowManager.getDefault().getMainWindow();
mainWindow
.getGlasspane()
.setCursor(Cursor.getPredefinedCursor(
on ?
Cursor.WAIT_CURSOR :
Cursor.DEFAULT_CURSOR));
mainWindow.getGlasspane().setVisible(on);
}
};
if(EventQueue.isdispatchThread()) {
r.run();
} else {
EventQueue.invokelater(r);
}
}
@Override
public void showHistory() {
getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
SwingUtilities.invokelater(new Runnable() {
@Override
public void run() {
try {
sqlHistoryPanel panel = new sqlHistoryPanel(getEditorPane());
Object[] options = new Object[]{
DialogDescriptor.CLOSED_OPTION
};
final DialogDescriptor desc = new DialogDescriptor(panel,NbBundle.getMessage(sqlCloneableEditor.class,"LBL_sql_HISTORY_TITLE"),false,options,DialogDescriptor.CLOSED_OPTION,DialogDescriptor.DEFAULT_ALIGN,new HelpCtx("sql_history"),null); // NOI18N
Dialog dlg = Dialogdisplayer.getDefault().createDialog(desc);
dlg.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(sqlCloneableEditor.class,"ACSD_DLG"));
dlg.setVisible(true);
} finally {
getComponent().setCursor(null);
}
}
});
}
项目:incubator-netbeans
文件:SummaryCellRenderer.java
@Override
public boolean mouseMoved(Point p,JComponent component) {
if (bounds != null && bounds.contains(p)) {
component.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
int i = item.getNextFilesToShowCount();
String tooltip;
if (i > 0) {
tooltip = NbBundle.getMessage(SummaryCellRenderer.class,"MSG_ShowMoreFiles",i); //NOI18N
} else {
tooltip = NbBundle.getMessage(SummaryCellRenderer.class,"MSG_ShowAllFiles"); //NOI18N
}
component.setToolTipText(tooltip);
return true;
}
return false;
}
static void setCursor(int c,Object display) {
Container d = (Container) display;
switch (c) {
case JmolConstants.CURSOR_HAND:
c = Cursor.HAND_CURSOR;
break;
case JmolConstants.CURSOR_MOVE:
c = Cursor.MOVE_CURSOR;
break;
case JmolConstants.CURSOR_ZOOM:
c = Cursor.N_RESIZE_CURSOR;
break;
case JmolConstants.CURSOR_CROSSHAIR:
c = Cursor.CROSSHAIR_CURSOR;
break;
case JmolConstants.CURSOR_WAIT:
c = Cursor.WAIT_CURSOR;
break;
default:
d.setCursor(Cursor.getDefaultCursor());
return;
}
d.setCursor(Cursor.getPredefinedCursor(c));
}
项目:jdk8u-jdk
文件:MultiResolutionCursorTest.java
public void start() {
//Get things going. Request focus,set size,et cetera
setSize(200,200);
setVisible(true);
validate();
final Image image = new MultiResolutionCursor();
int center = sizes[0] / 2;
Cursor cursor = Toolkit.getDefaultToolkit().createCustomCursor(
image,new Point(center,center),"multi-resolution cursor");
Frame frame = new Frame("Test Frame");
frame.setSize(300,300);
frame.setLocation(300,50);
frame.add(new Label("Move cursor here"));
frame.setCursor(cursor);
frame.setVisible(true);
}
项目:SER316-Aachen
文件:DailyItemsPanel.java
void currentProjectChanged(Project newprj,NoteList nl,TaskList tl,ResourcesList rl) {
// Util.debug("currentProjectChanged");
Cursor cur = App.getFrame().getCursor();
App.getFrame().setCursor(waitCursor);
if (!changedByHistory)
History.add(new HistoryItem(CurrentDate.get(),newprj));
if (editorPanel.isDocumentChanged())
saveNote();
/*if ((currentNote != null) && !changedByHistory && !addedToHistory)
History.add(new HistoryItem(currentNote));*/
CurrentProject.save();
/*addedToHistory = false;
if (!changedByHistory) {
if (currentNote != null) {
History.add(new HistoryItem(currentNote));
addedToHistory = true;
}
}*/
updateIndicators(CurrentDate.get(),tl);
App.getFrame().setCursor(cur);
}
项目:incubator-netbeans
文件:IsOverriddenPopup.java
/** Creates new form IsOverriddenPopup */
public IsOverriddenPopup(String caption,List<ElementDescription> declarations) {
this.caption = caption;
this.declarations = declarations;
Collections.sort(declarations,new Comparator<ElementDescription>() {
public int compare(ElementDescription o1,ElementDescription o2) {
if (o1.isOverridden() == o2.isOverridden()) {
return o1.getdisplayName().compareto(o2.getdisplayName());
}
if (o1.isOverridden()) {
return 1;
}
return -1;
}
});
initComponents();
jList1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
addFocusListener(this);
}
@Override
public void run() {
final ActionsTree tree = new ActionsTree();
tree.getAccessibleContext().setAccessibleDescription( getBundleString("ACSD_ActionsTree") );
tree.getAccessibleContext().setAccessibleName( getBundleString("ACSN_ActionsTree") );
palettePanel.removeAll();
palettePanel.setBorder( BorderFactory.createEtchedBorder() );
palettePanel.add( tree,BorderLayout.CENTER );
lblHint.setLabelFor( tree );
invalidate();
validate();
repaint();
setCursor( Cursor.getDefaultCursor() );
explorerManager.setRootContext( root );
tree.expandAll();
}
项目:geomapapp
文件:WWMapApp.java
protected void showDSDP() {
if (whichMap == WORLDWIND) {
map.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
map.getTopLevelAncestor().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
if( dsdp==null ) dsdp=new DSDPDemo(this,new haxby.worldwind.db.dsdp.WWDSDP());
dsdp.show();
map.getTopLevelAncestor().setCursor(Cursor.getDefaultCursor());
map.setCursor(Cursor.getDefaultCursor());
} else
super.showDSDP();
}
项目:litiengine
文件:RenderComponent.java
public RenderComponent(final Dimension size) {
this.renderedConsumer = new copyOnWriteArrayList<>();
this.fpsChangedConsumer = new copyOnWriteArrayList<>();
// hide default cursor
final BufferedImage cursorImg = ImageProcessing.getCompatibleImage(16,16);
final Cursor blankCursor = Toolkit.getDefaultToolkit().createCustomCursor(cursorImg,new Point(0,0),"blank cursor");
this.setCursor(blankCursor);
this.setSize(size);
// canvas will scale when the size of this jframe gets changed
this.setPreferredSize(size);
}
项目:KernelHive
文件:RepositoryViewerDragGestureListener.java
@Override
public void dragGestureRecognized(DragGestureEvent dge) {
Cursor cursor = null;
if(dge.getComponent() instanceof RepositoryViewer){
RepositoryViewer rv = (RepositoryViewer) dge.getComponent();
KernelRepositoryEntry kre = (KernelRepositoryEntry) rv.getSelectedValue();
if(dge.getDragAction()==DnDConstants.ACTION_copY){
cursor = DragSource.DefaultcopyDrop;
}
dge.startDrag(cursor,new TransferableKernelRepositoryEntry(kre));
}
}
项目:openjdk-jdk10
文件:LWTextAreaPeer.java
@Override
Cursor getCursor(final Point p) {
final boolean isContains;
synchronized (getDelegateLock()) {
isContains = getDelegate().getViewport().getBounds().contains(p);
}
return isContains ? super.getCursor(p) : null;
}
项目:FreeCol
文件:DefaultTransferHandler.java
/**
* Get a suitable cursor for the given component.
*
* @param c The component to consider.
* @return A suitable {@code Cursor},or null on failure.
*/
private Cursor getCursor(JComponent c) {
if (c instanceof JLabel
&& ((JLabel)c).getIcon() instanceof ImageIcon) {
Toolkit tk = Toolkit.getDefaultToolkit();
ImageIcon imageIcon = ((ImageIcon)((JLabel)c).getIcon());
Dimension bestSize = tk.getBestCursorSize(imageIcon.getIconWidth(),imageIcon.getIconHeight());
if (bestSize.width == 0 || bestSize.height == 0) return null;
if (bestSize.width > bestSize.height) {
bestSize.height = (int)((((double)bestSize.width)
/ ((double)imageIcon.getIconWidth()))
* imageIcon.getIconHeight());
} else {
bestSize.width = (int)((((double)bestSize.height)
/ ((double)imageIcon.getIconHeight()))
* imageIcon.getIconWidth());
}
BufferedImage scaled = ImageLibrary
.createResizedImage(imageIcon.getimage(),bestSize.width,bestSize.height);
Point point = new Point(bestSize.width / 2,bestSize.height / 2);
try {
return tk.createCustomCursor(scaled,point,"freeColDragIcon");
} catch (Exception ex) {
; // Fall through
}
}
return null;
}
项目:Luyten4Forge
文件:OpenFile.java
private void resetCursor() {
SwingUtilities.invokelater(new Runnable() {
@Override
public void run() {
textArea.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
});
}
/**
* Статический метод который показывает модально диалог ввода строки.
*
* @param parent фрейм относительно которого будет модальность
* @param modal модальный диалог или нет
* @param netProperty свойства работы с сервером
* @param fullscreen растягивать форму на весь экран и прятать мышку или нет
* @param delay задержка перед скрытием диалога. если 0,то нет автозакрытия диалога
* @return XML-описание результата предварительной записи,по сути это номерок. если null,то
* отказались от предварительной записи
*/
public static String showInputDialog(Frame parent,boolean modal,INetProperty netProperty,boolean fullscreen,int delay,String caption) {
FInputDialog.delay = delay;
QLog.l().logger().info("Ввод клиентской информации");
if (inputDialog == null) {
inputDialog = new FInputDialog(parent,modal);
inputDialog.setTitle("Ввод клиентской информации");
}
result = "";
inputDialog.setSize(1280,768);
Uses.setLocation(inputDialog);
FInputDialog.netProperty = netProperty;
inputDialog.jLabel2.setText(caption);
inputDialog.changeTextToLocale();
if (!(QConfig.cfg().isDebug() || QConfig.cfg().isDemo() && !fullscreen)) {
Uses.setFullSize(inputDialog);
if (QConfig.cfg().isHideCursor()) {
int[] pixels = new int[16 * 16];
Image image = Toolkit.getDefaultToolkit()
.createImage(new MemoryImageSource(16,16,pixels,16));
Cursor transparentCursor = Toolkit.getDefaultToolkit()
.createCustomCursor(image,"invisibleCursor");
inputDialog.setCursor(transparentCursor);
}
}
inputDialog.labelKod.setText(inputDialog.resourceMap.getString("labelKod.text"));
if (inputDialog.clockBack.isActive()) {
inputDialog.clockBack.stop();
}
inputDialog.clockBack.start();
inputDialog.setVisible(true);
return result;
}
项目:JAddOn
文件:JExpandableTextArea.java
@Override
public void mouseMoved(MouseEvent e) {
final Point p = e.getPoint();
final polygon polygon = getTriangle();
if(polygon.contains(p)){
inTheTriangleZone = true;
this.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
this.repaint();
} else {
inTheTriangleZone = false;
this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
this.repaint();
}
}
项目:incubator-netbeans
文件:JFXProjectOpenedHook.java
private void switchDefault() {
SwingUtilities.invokelater(new Runnable() {
@Override
public void run() {
WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
});
}
public void toPosition(boolean isDebug,int x,int y) {
// Определим форму на монитор
setLocation(x,y);
setAlwaysOnTop(!isDebug);
//setResizable(isDebug);
// Отрехтуем форму в зависимости от режима.
if (!isDebug) {
setAlwaysOnTop(true);
//setResizable(false);
// спрячем курсор мыши
int[] pixels = new int[16 * 16];
Image image = Toolkit.getDefaultToolkit()
.createImage(new MemoryImageSource(16,16));
Cursor transparentCursor = Toolkit.getDefaultToolkit()
.createCustomCursor(image,"invisibleCursor");
setCursor(transparentCursor);
addWindowListener(new WindowAdapter() {
@Override
public void windowOpened(WindowEvent e) {
setExtendedState(JFrame.MAXIMIZED_BOTH);
}
});
} else {
setSize(1280,720);
}
}
项目:incubator-netbeans
文件:CustomizerProviderImpl.java
public void run() {
try {
JFrame f = (JFrame) WindowManager.getDefault().getMainWindow();
Component c = f.getGlasspane();
c.setVisible(show);
c.setCursor(show ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null);
} catch (NullPointerException npe) {
Exceptions.printstacktrace(npe);
}
}
public void toPosition(boolean isDebug,int y) {
// Определим форму на монитор
final Rectangle bounds = Uses.disPLAYS.get(monitor);
if (bounds != null) {
x = bounds.x + 1;
y = bounds.y + 1;
}
setLocation(x,y);
setAlwaysOnTop(!isDebug);
// setResizable(isDebug);
// Отрехтуем форму в зависимости от режима.
if (!isDebug) {
setAlwaysOnTop(true);
// setResizable(false);
// спрячем курсор мыши
if (QConfig.cfg().isHideCursor()) {
int[] pixels = new int[16 * 16];
Image image = Toolkit.getDefaultToolkit()
.createImage(new MemoryImageSource(16,"invisibleCursor");
setCursor(transparentCursor);
}
setBounds(x,y,200,300);
addWindowListener(new WindowAdapter() {
@Override
public void windowOpened(WindowEvent e) {
setExtendedState(JFrame.MAXIMIZED_BOTH);
}
});
} else {
setSize(1280,720);
}
}
项目:OpenDiabetes
文件:Grid.java
/**
* Method declaration
*
*
* @param e
* @param x
* @param y
*/
public boolean mouseMove(Event e,int y) {
if (y <= iRowHeight) {
int xb = x;
x += iX - iGridWidth;
int i = iColCount - 1;
for (; i >= 0; i--) {
if (x > -7 && x < 7) {
break;
}
x += iColWidth[i];
}
if (i >= 0) {
if (!bDrag) {
setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
bDrag = true;
iXDrag = xb - iColWidth[i];
iColDrag = i;
}
return true;
}
}
return mouseExit(e,x,y);
}
项目:incubator-netbeans
文件:UtilitiesProgressCursorTest.java
public void testProgressCursor () {
JComponent testTc = new ProgressCursorComp();
Cursor progressCursor = Utilities.createProgressCursor(testTc);
testTc.setCursor(progressCursor);
//testTc.open();
Cursor compCursor = testTc.getCursor();
if (!progressCursor.equals(compCursor)) {
fail("Setting of progress cursor don't work: \n" +
"Comp cursor: " + compCursor + "\n" +
"Progress cursor: " + progressCursor);
}
}
项目:incubator-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);
}
}
项目:batmapper
文件:MapperPickingGraphMousePlugin.java
/**
* create an instance with overides
*
* @param selectionModifiers for primary selection
* @param addToSelectionModifiers for additional selection
*/
public MapperPickingGraphMousePlugin( int selectionModifiers,int addToSelectionModifiers ) {
super( selectionModifiers );
this.addToSelectionModifiers = addToSelectionModifiers;
this.lensPaintable = new LensPaintable();
this.cursor = Cursor.getPredefinedCursor( Cursor.HAND_CURSOR );
}
项目:incubator-netbeans
文件:BaseTable.java
项目:jmt
文件:TemplateAddingPanel.java
项目:JavaGraph
文件:JGraphUI.java
private void startEdgeAdding(MouseEvent e) {
// possibly start adding edge
this.edgeAdding = true;
this.edgeAddStart = e;
getJGraph().setCursor(
Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
}
项目:brModelo
文件:Elementar.java
private void InitElementar(FormaElementar pai) {
criador = pai;
if (criador != null) {
this.master = criador.getMaster();
criador.getSubItens().add(this);
SetFontAndBackColorFromModelo();
}
this.cursor = new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR);
}
项目:TrabalhoFinalEDA2
文件:mxVertexHandler.java
/**
*
*/
protected Cursor getCursor(MouseEvent e,int index)
{
if (index >= 0 && index <= CURSORS.length)
{
return CURSORS[index];
}
return null;
}
public static boolean getMayContinue(JFrame owner,int count) {
QLog.l().logger()
.info("Просмотр состояния очереди и принятие решения о постановки себя в очередь.");
ok = false;
if (confirmationForm == null) {
confirmationForm = new FConfirmationStart2(owner,count);
}
confirmationForm.changeTextToLocale(count);
//confirmationForm.labelInfo.setText("<HTML><b><p align=center><span style='font-size:60.0pt;color:green'>" + getLocaleMessage("dialod.text_before") + "</span><br>"
// + "<span style='font-size:100.0pt;color:red'>" + count + "</span><br><span style='font-size:60.0pt;color:red'>" + getLocaleMessage("dialod.text_before_people")
// + (((!Locale.getDefault().getLanguage().startsWith("en")) && ((count % 10) >= 2) && ((count % 10) <= 4)) ? "a" : "") + "</span></p></b>");
//confirmationForm.setBounds(owner.getLocation().x,owner.getLocation().y,owner.getWidth(),owner.getHeight());
Uses.setLocation(confirmationForm);
if (!(QConfig.cfg().isDebug() || QConfig.cfg().isDemo())) {
Uses.setFullSize(confirmationForm);
if (QConfig.cfg().isHideCursor()) {
int[] pixels = new int[16 * 16];
Image image = Toolkit.getDefaultToolkit()
.createImage(new MemoryImageSource(16,"invisibleCursor");
confirmationForm.setCursor(transparentCursor);
}
} else {
confirmationForm.setSize(1280,768);
Uses.setLocation(confirmationForm);
}
// если кастомер провафлил и ушел,то надо закрыть диалог
CLOCK.start();
confirmationForm.setVisible(true);
return ok;
}
项目:freecol
文件:Utility.java
/**
* Return a button suitable for linking to another panel
* (e.g. ColopediaPanel).
*
* @param text a {@code String} value
* @param icon an {@code Icon} value
* @param action a {@code String} value
* @return a {@code JButton} value
*/
public static JButton getLinkButton(String text,Icon icon,String action) {
JButton button = new JButton(text,icon);
button.setMargin(EMPTY_MARGIN);
button.setopaque(false);
button.setForeground(LINK_COLOR);
button.setAlignmentY(0.8f);
button.setBorder(blankBorder(0,0));
button.setActionCommand(action);
button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
return button;
}
项目:incubator-netbeans
文件:VCSHyperlinkSupport.java
@Override
public boolean mouseMoved(Point p,JComponent component) {
for (int i = 0; i < start.length; i++) {
if (bounds != null && bounds[i] != null && bounds[i].contains(p)) {
component.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
return true;
}
}
return false;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。