Skip to content
Snippets Groups Projects
Commit f2946877 authored by Thomas  MUSSET's avatar Thomas MUSSET
Browse files

updated to v4.0.0-a.2, fix dragging in BlockPanel by adding an icon

parent 2c627994
No related branches found
No related tags found
No related merge requests found
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
<parent> <parent>
<groupId>org.bioimageanalysis.icy</groupId> <groupId>org.bioimageanalysis.icy</groupId>
<artifactId>pom-icy</artifactId> <artifactId>pom-icy</artifactId>
<version>3.0.0-a.1</version> <version>3.0.0-a.4</version>
</parent> </parent>
<artifactId>protocols</artifactId> <artifactId>protocols</artifactId>
<version>4.0.0-a.1</version> <version>4.0.0-a.2</version>
<name>Protocols</name> <name>Protocols</name>
<description> <description>
...@@ -33,11 +33,4 @@ ...@@ -33,11 +33,4 @@
<artifactId>javacl</artifactId> <artifactId>javacl</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<repositories>
<repository>
<id>icy</id>
<url>https://nexus-icy.pasteur.cloud/repository/icy/</url>
</repository>
</repositories>
</project> </project>
\ No newline at end of file
...@@ -269,6 +269,8 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener ...@@ -269,6 +269,8 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener
*/ */
private static final ImageIcon ICON_ERROR = new IcySVGImageIcon(SVGIcon.ERROR, Color.RED.darker()); private static final ImageIcon ICON_ERROR = new IcySVGImageIcon(SVGIcon.ERROR, Color.RED.darker());
private static final ImageIcon ICON_DRAG = new IcySVGImageIcon(SVGIcon.DRAG_PAN);
protected final JToolBar toolBar; protected final JToolBar toolBar;
protected final JPanel jPanelContent = new JPanel(new GridBagLayout()); protected final JPanel jPanelContent = new JPanel(new GridBagLayout());
...@@ -276,6 +278,7 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener ...@@ -276,6 +278,7 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener
protected final JButton bMenu = new JButton(ICON_BLOCKS); protected final JButton bMenu = new JButton(ICON_BLOCKS);
protected final IcyButton bRunUntilHere = new IcyButton(SVGIcon.PLAY_CIRCLE); protected final IcyButton bRunUntilHere = new IcyButton(SVGIcon.PLAY_CIRCLE);
protected final JButton bID = new JButton(""); protected final JButton bID = new JButton("");
protected final JLabel dragLabel = new JLabel(ICON_DRAG);
protected final JLabel bStatus = new JLabel(ICON_DIRTY); protected final JLabel bStatus = new JLabel(ICON_DIRTY);
protected final JPopupMenu menu = new JPopupMenu(); protected final JPopupMenu menu = new JPopupMenu();
protected final JCheckBox menuKeepResults = new JCheckBox("Remember results"); protected final JCheckBox menuKeepResults = new JCheckBox("Remember results");
...@@ -328,7 +331,7 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener ...@@ -328,7 +331,7 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener
//name = new JLabel(" " + blockDesc.getDefinedName() + " ", JLabel.CENTER); //name = new JLabel(" " + blockDesc.getDefinedName() + " ", JLabel.CENTER);
name = new JTextField(blockDesc.getDefinedName()); name = new JTextField(blockDesc.getDefinedName());
name.setBorder(null); name.setBorder(null);
name.setOpaque(false); name.setOpaque(true);
name.setEditable(false); name.setEditable(false);
name.setFocusable(false); name.setFocusable(false);
name.addKeyListener(new KeyListener() { name.addKeyListener(new KeyListener() {
...@@ -350,7 +353,7 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener ...@@ -350,7 +353,7 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener
name.setText(newName); name.setText(newName);
name.setEditable(false); name.setEditable(false);
name.setFocusable(false); name.setFocusable(false);
name.setOpaque(false); name.setOpaque(true);
btnEdit.setEnabled(true); btnEdit.setEnabled(true);
} }
else if (e.getExtendedKeyCode() == KeyEvent.VK_ESCAPE) { else if (e.getExtendedKeyCode() == KeyEvent.VK_ESCAPE) {
...@@ -358,7 +361,7 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener ...@@ -358,7 +361,7 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener
name.setText(tmpName); name.setText(tmpName);
name.setEditable(false); name.setEditable(false);
name.setFocusable(false); name.setFocusable(false);
name.setOpaque(false); name.setOpaque(true);
btnEdit.setEnabled(true); btnEdit.setEnabled(true);
} }
} }
...@@ -384,13 +387,18 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener ...@@ -384,13 +387,18 @@ public class BlockPanel extends JPanel implements ActionListener, BlockListener
toolBar.add(btnEdit); toolBar.add(btnEdit);
toolBar.add(Box.createHorizontalStrut(10));
updateStatusIcon(blockDesc.getStatus()); updateStatusIcon(blockDesc.getStatus());
toolBar.add(bStatus); toolBar.add(bStatus);
toolBar.add(Box.createHorizontalStrut(5)); toolBar.add(Box.createHorizontalStrut(5));
toolBar.add(dragLabel); // FIXME: Dragging is disable when changing theme
dragLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
dragLabel.setFocusable(false);
dragLabel.setOpaque(false);
toolBar.add(Box.createHorizontalStrut(5));
// Need to remove all the mouse listeners to dispatch the event // Need to remove all the mouse listeners to dispatch the event
for (final MouseListener ml : toolBar.getMouseListeners()) for (final MouseListener ml : toolBar.getMouseListeners())
toolBar.removeMouseListener(ml); toolBar.removeMouseListener(ml);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment