Search in sources :

Example 41 with Cursor

use of java.awt.Cursor in project vcell by virtualcell.

the class PythonConfigurationPanel2 method initialize.

private void initialize() {
    setLayout(new BorderLayout());
    Border margin = new EmptyBorder(5, 3, 1, 1);
    Border loweredEtchedBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    TitledBorder panelBorder = BorderFactory.createTitledBorder(loweredEtchedBorder, " Python Properties ");
    panelBorder.setTitleJustification(TitledBorder.LEFT);
    panelBorder.setTitlePosition(TitledBorder.TOP);
    panelBorder.setTitleFont(getFont().deriveFont(Font.BOLD));
    JPanel mainPanel = new JPanel();
    mainPanel.setBorder(new CompoundBorder(margin, panelBorder));
    mainPanel.setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.weighty = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.gridheight = 1;
    add(mainPanel, BorderLayout.CENTER);
    JPanel upper = new JPanel();
    // TitledBorder titleLeft = BorderFactory.createTitledBorder(loweredEtchedBorder, " Original Physiology ");
    // titleLeft.setTitleJustification(TitledBorder.LEFT);
    // titleLeft.setTitlePosition(TitledBorder.TOP);
    // upper.setBorder(titleLeft);
    upper.setLayout(new GridBagLayout());
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.weightx = 0.5;
    gbc.weighty = 1.0;
    gbc.fill = GridBagConstraints.BOTH;
    // top, left, bottom, right
    gbc.insets = new Insets(5, 2, 2, 3);
    mainPanel.add(upper, gbc);
    // ============================================= Populating the upper group box =================
    String managedMiniconda = new File(ResourceUtil.getVcellHome(), "Miniconda").getAbsolutePath();
    String vcellPythonText = "<html>" + "Python is required for parameter estimation and other analysis.<br>" + "VCell manages a dedicated Miniconda python installation " + "at <font color=#8C001A>" + managedMiniconda + "</font>.<br>" + "</html>";
    String vcellPythonText2 = "<html>" + "For more information about Miniconda, see:" + "</html>";
    websiteLabel.setText(textContinuum);
    websiteLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
    int gridy = 0;
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.weightx = 1;
    gbc.gridwidth = 2;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.insets = new Insets(4, 4, 2, 10);
    upper.add(new JLabel(vcellPythonText), gbc);
    gridy++;
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.weightx = 1;
    gbc.gridwidth = 2;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.insets = new Insets(10, 4, 0, 10);
    upper.add(new JLabel(vcellPythonText2), gbc);
    gridy++;
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.weightx = 1;
    gbc.gridwidth = 2;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.insets = new Insets(0, 4, 2, 10);
    upper.add(websiteLabel, gbc);
    // --------------------------------------------------
    gridy++;
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.weightx = 1;
    gbc.gridwidth = 1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(4, 4, 4, 10);
    upper.add(new JLabel(""), gbc);
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = gridy;
    // gbc.weightx = 1;
    gbc.gridwidth = 1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.EAST;
    // top, left, bottom, right
    gbc.insets = new Insets(4, 4, 4, 10);
    upper.add(getTestConfigurationButton(), gbc);
    gridy++;
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = gridy;
    // gbc.weightx = 1;
    gbc.gridwidth = 1;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.insets = new Insets(4, 4, 4, 10);
    upper.add(getInstallPythonButton(), gbc);
    // Dimension size = getTestConfigurationButton().getPreferredSize();
    // getTestConfigurationButton().setPreferredSize(size);
    // getTestConfigurationButton().setMaximumSize(size);
    // getInstallPythonButton().setSize(size);
    // getInstallPythonButton().setPreferredSize(size);
    // getInstallPythonButton().setMaximumSize(size);
    // --------------------------------------------------------
    gridy++;
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    // fake cell used for filling all the vertical empty space
    gbc.weighty = 1;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.insets = new Insets(4, 4, 4, 10);
    upper.add(new JLabel(""), gbc);
    gridy++;
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = gridy;
    gbc.weightx = 1;
    gbc.gridwidth = 2;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.EAST;
    gbc.insets = new Insets(4, 4, 2, 10);
    upper.add(testConfigurationResults, gbc);
    getTestConfigurationButton().addActionListener(eventHandler);
    getInstallPythonButton().addActionListener(eventHandler);
    addFocusListener(eventHandler);
    websiteLabel.addMouseListener(eventHandler);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) TitledBorder(javax.swing.border.TitledBorder) Cursor(java.awt.Cursor) BorderLayout(java.awt.BorderLayout) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder) Border(javax.swing.border.Border) CompoundBorder(javax.swing.border.CompoundBorder) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder) EtchedBorder(javax.swing.border.EtchedBorder) File(java.io.File)

Example 42 with Cursor

use of java.awt.Cursor in project vcell by virtualcell.

the class ImagePlaneManagerPanel method setToolCursor.

/**
 * Insert the method's description here.
 * Creation date: (7/4/2003 12:04:20 PM)
 */
private void setToolCursor() {
    Cursor cursor = Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
    if (getCurveEditorTool() != null) {
        if (getCurveEditorTool().getTool() == cbit.vcell.geometry.gui.CurveEditorTool.TOOL_PAN) {
            cursor = panCursor;
        // cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR);
        } else if (getCurveEditorTool().getTool() == cbit.vcell.geometry.gui.CurveEditorTool.TOOL_ZOOM) {
            cursor = zoomCursor;
        // cursor = Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR);
        }
    }
    org.vcell.util.BeanUtils.setCursorThroughout(getImagePaneScroller1(), cursor);
}
Also used : Cursor(java.awt.Cursor)

Example 43 with Cursor

use of java.awt.Cursor in project n2a by frothga.

the class FixedParameterSpacePanel method dragGestureRecognized.

public void dragGestureRecognized(DragGestureEvent event) {
    Cursor cursor = null;
    SimpleTree list = (SimpleTree) event.getComponent();
    TreePath[] paths = list.getSelectionPaths();
    if (paths == null) {
        return;
    }
    List<ParameterBundle> bundles = getSelectedParamsAsBundles(paths);
    if (bundles == null) {
        return;
    }
    if (event.getDragAction() == DnDConstants.ACTION_LINK) {
        cursor = DragCursors.getGrabhandcursor();
    }
    event.startDrag(cursor, new TransferableParameterBundles(bundles));
}
Also used : TreePath(javax.swing.tree.TreePath) ParameterBundle(gov.sandia.n2a.parms.ParameterBundle) Cursor(java.awt.Cursor) SimpleTree(replete.gui.controls.simpletree.SimpleTree)

Example 44 with Cursor

use of java.awt.Cursor in project knime-core by knime.

the class AbstractPlotter2D method mouseExited.

/**
 * {@inheritDoc}
 */
public void mouseExited(final MouseEvent e) {
    if (m_crosshair) {
        m_drawingPane.clearCursorCoord();
        // set the cursor back
        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        repaint();
    }
}
Also used : Cursor(java.awt.Cursor)

Aggregations

Cursor (java.awt.Cursor)44 Point (java.awt.Point)9 Component (java.awt.Component)6 MouseEvent (java.awt.event.MouseEvent)5 File (java.io.File)5 JFrame (javax.swing.JFrame)5 BorderLayout (java.awt.BorderLayout)4 JPanel (javax.swing.JPanel)4 Dimension (java.awt.Dimension)3 IOException (java.io.IOException)3 JFileChooser (javax.swing.JFileChooser)3 JLabel (javax.swing.JLabel)3 ParameterBundle (gov.sandia.n2a.parms.ParameterBundle)2 Color (java.awt.Color)2 GridBagConstraints (java.awt.GridBagConstraints)2 GridBagLayout (java.awt.GridBagLayout)2 Insets (java.awt.Insets)2 StringSelection (java.awt.datatransfer.StringSelection)2 InvalidDnDOperationException (java.awt.dnd.InvalidDnDOperationException)2 MouseAdapter (java.awt.event.MouseAdapter)2