[Pixelle-commit] SF.net SVN: pixelle:[194] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-11-15 16:37:52
|
Revision: 194
http://pixelle.svn.sourceforge.net/pixelle/?rev=194&view=rev
Author: dbrosius
Date: 2008-11-15 16:37:50 +0000 (Sat, 15 Nov 2008)
Log Message:
-----------
make inspector more usable by allowing freezing
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-11-14 23:35:48 UTC (rev 193)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-11-15 16:37:50 UTC (rev 194)
@@ -84,6 +84,7 @@
public static final String X = "label.x";
public static final String Y = "label.y";
public static final String COLOR = "label.color";
+ public static final String INSPECTOR_TOOLTIP = "tooltip.inspector";
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-14 23:35:48 UTC (rev 193)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-15 16:37:50 UTC (rev 194)
@@ -26,6 +26,7 @@
import java.awt.Graphics;
import java.awt.Point;
import java.awt.Rectangle;
+import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.WindowAdapter;
@@ -302,13 +303,19 @@
private ZoomLevel zoom = ZoomLevel.FitToWindow;
private final int[] color = new int[4];
private Point lastPoint = new Point();
+ private boolean frozen = false;
public ImagePanel() {
+
+ initListeners();
+ }
+
+ private void initListeners() {
addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseMoved(MouseEvent e) {
- if (inspector != null) {
+ if ((inspector != null) && !frozen) {
Point p = e.getPoint();
if (!lastPoint.equals(p)) {
lastPoint = p;
@@ -327,7 +334,16 @@
}
}
});
+
+ addMouseListener(new MouseAdapter() {
+
+ @Override
+ public void mouseClicked(MouseEvent e) {
+ frozen = !frozen;
+ }
+ });
}
+
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-14 23:35:48 UTC (rev 193)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelInspector.java 2008-11-15 16:37:50 UTC (rev 194)
@@ -21,6 +21,7 @@
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
+import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Point;
import java.awt.event.WindowAdapter;
@@ -50,6 +51,7 @@
public PixelInspector(PixelleFrame pf) {
frame = pf;
+ setTitle(PixelleBundle.getString(PixelleBundle.INSPECTOR_ITEM));
initComponents();
initListeners();
}
@@ -79,7 +81,7 @@
if (b.length() == 1)
sb.append('0');
sb.append(b);
- colorField.setText(sb.toString());
+ colorField.setText(sb.toString().toUpperCase());
swatchPanel.setBackground(c);
swatchPanel.repaint();
}
@@ -90,7 +92,8 @@
cp.setLayout(new BorderLayout(4, 4));
swatchPanel = new JPanel();
- swatchPanel.setSize(100, 100);
+ swatchPanel.setPreferredSize(new Dimension(50, 50));
+ swatchPanel.setToolTipText(PixelleBundle.getString(PixelleBundle.INSPECTOR_TOOLTIP));
cp.add(swatchPanel, BorderLayout.WEST);
JPanel infoPanel = new JPanel();
@@ -106,9 +109,9 @@
colorField = new JTextField(6);
GuiUtils.sizeUniformly(Sizing.Both, xField, yField, colorField);
- xField.setEnabled(false);
- yField.setEnabled(false);
- colorField.setEnabled(false);
+ xField.setEditable(false);
+ yField.setEditable(false);
+ colorField.setEditable(false);
xLabel.setLabelFor(xField);
yLabel.setLabelFor(yField);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-11-14 23:35:48 UTC (rev 193)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-11-15 16:37:50 UTC (rev 194)
@@ -86,3 +86,6 @@
label.x = x:
label.y = y:
label.color = color:
+
+tooltip.inspector = Click in the frame's window to freeze the inspector value, and click again to unfreeze
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|