From ad417fec4d5b0bd83f31c5142fff8d452ab9433a Mon Sep 17 00:00:00 2001
From: Miguel Alejandro Moreno Barrientos
" + Application.APPNAME + " " - + Application.getLocaleText( "app_des" ) + + getLocaleText( "app_des" ) + "
" + ""
+ "GPLv3 license "
@@ -83,7 +84,7 @@ public void hyperlinkUpdate( HyperlinkEvent e )
}
});
JOptionPane.showMessageDialog( app, ep, "About " + Application.APPNAME,
- JOptionPane.PLAIN_MESSAGE,
- Application.getScaledIco( "jdrafting.png", 100, 100 ) );
+ JOptionPane.PLAIN_MESSAGE,
+ JDUtils.getScaledIco( "jdrafting.png", 100, 100 ) );
}
}
diff --git a/src/jdrafting/gui/controller/actions/AngleAction.java b/src/jdrafting/gui/controller/actions/AngleAction.java
index 2765a2d..b56d0e6 100644
--- a/src/jdrafting/gui/controller/actions/AngleAction.java
+++ b/src/jdrafting/gui/controller/actions/AngleAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/ArcAction.java b/src/jdrafting/gui/controller/actions/ArcAction.java
index 7f9236c..2034511 100644
--- a/src/jdrafting/gui/controller/actions/ArcAction.java
+++ b/src/jdrafting/gui/controller/actions/ArcAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/ArrowAction.java b/src/jdrafting/gui/controller/actions/ArrowAction.java
index 0889478..ad3de40 100644
--- a/src/jdrafting/gui/controller/actions/ArrowAction.java
+++ b/src/jdrafting/gui/controller/actions/ArrowAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/AxialSymmetryAction.java b/src/jdrafting/gui/controller/actions/AxialSymmetryAction.java
index 6ca9b2e..7212af9 100644
--- a/src/jdrafting/gui/controller/actions/AxialSymmetryAction.java
+++ b/src/jdrafting/gui/controller/actions/AxialSymmetryAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/BackwardAction.java b/src/jdrafting/gui/controller/actions/BackwardAction.java
index 1476aa4..a136870 100644
--- a/src/jdrafting/gui/controller/actions/BackwardAction.java
+++ b/src/jdrafting/gui/controller/actions/BackwardAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/BisectrixAction.java b/src/jdrafting/gui/controller/actions/BisectrixAction.java
index 7d6c1fb..4e9e816 100644
--- a/src/jdrafting/gui/controller/actions/BisectrixAction.java
+++ b/src/jdrafting/gui/controller/actions/BisectrixAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/BoundsAction.java b/src/jdrafting/gui/controller/actions/BoundsAction.java
index a2bc034..75935e5 100644
--- a/src/jdrafting/gui/controller/actions/BoundsAction.java
+++ b/src/jdrafting/gui/controller/actions/BoundsAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/CanvasColorAction.java b/src/jdrafting/gui/controller/actions/CanvasColorAction.java
index f913ee2..5fc24b5 100644
--- a/src/jdrafting/gui/controller/actions/CanvasColorAction.java
+++ b/src/jdrafting/gui/controller/actions/CanvasColorAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
@@ -36,7 +36,7 @@ public CanvasColorAction( Application app )
jcc = new JColorChooser();
colorChooser = JColorChooser.createDialog(
- app, getLocaleText( "background_color_des" ), false, jcc,
+ app, getLocaleText( "background_color_des" ), true, jcc,
(evt) -> app.setBackColor( jcc.getColor() ), // ok
null ); // cancel
}
diff --git a/src/jdrafting/gui/controller/actions/CapableArcAction.java b/src/jdrafting/gui/controller/actions/CapableArcAction.java
index 9f0fe59..dea1e9a 100644
--- a/src/jdrafting/gui/controller/actions/CapableArcAction.java
+++ b/src/jdrafting/gui/controller/actions/CapableArcAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/CentralSymmetryAction.java b/src/jdrafting/gui/controller/actions/CentralSymmetryAction.java
index 52a32b1..2c8273e 100644
--- a/src/jdrafting/gui/controller/actions/CentralSymmetryAction.java
+++ b/src/jdrafting/gui/controller/actions/CentralSymmetryAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/CircumferenceAction.java b/src/jdrafting/gui/controller/actions/CircumferenceAction.java
index 336e05a..96a5d61 100644
--- a/src/jdrafting/gui/controller/actions/CircumferenceAction.java
+++ b/src/jdrafting/gui/controller/actions/CircumferenceAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/CopySelectedAction.java b/src/jdrafting/gui/controller/actions/CopySelectedAction.java
index fc6a26b..a5e3beb 100644
--- a/src/jdrafting/gui/controller/actions/CopySelectedAction.java
+++ b/src/jdrafting/gui/controller/actions/CopySelectedAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/DeleteSelectedAction.java b/src/jdrafting/gui/controller/actions/DeleteSelectedAction.java
index 0102405..adc20a4 100644
--- a/src/jdrafting/gui/controller/actions/DeleteSelectedAction.java
+++ b/src/jdrafting/gui/controller/actions/DeleteSelectedAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
diff --git a/src/jdrafting/gui/controller/actions/DivisionPointsAction.java b/src/jdrafting/gui/controller/actions/DivisionPointsAction.java
index d1f90ce..ea3a2cb 100644
--- a/src/jdrafting/gui/controller/actions/DivisionPointsAction.java
+++ b/src/jdrafting/gui/controller/actions/DivisionPointsAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/EllipseAction.java b/src/jdrafting/gui/controller/actions/EllipseAction.java
index 244a460..1c03fd9 100644
--- a/src/jdrafting/gui/controller/actions/EllipseAction.java
+++ b/src/jdrafting/gui/controller/actions/EllipseAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/EndAction.java b/src/jdrafting/gui/controller/actions/EndAction.java
index 151d6df..1261c40 100644
--- a/src/jdrafting/gui/controller/actions/EndAction.java
+++ b/src/jdrafting/gui/controller/actions/EndAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/ExerciseMetadataAction.java b/src/jdrafting/gui/controller/actions/ExerciseMetadataAction.java
index bcd4eda..12a03ed 100644
--- a/src/jdrafting/gui/controller/actions/ExerciseMetadataAction.java
+++ b/src/jdrafting/gui/controller/actions/ExerciseMetadataAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/ExitAction.java b/src/jdrafting/gui/controller/actions/ExitAction.java
index bbb7674..730d84d 100644
--- a/src/jdrafting/gui/controller/actions/ExitAction.java
+++ b/src/jdrafting/gui/controller/actions/ExitAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/ExtremesAction.java b/src/jdrafting/gui/controller/actions/ExtremesAction.java
index 4b0b697..9c059f2 100644
--- a/src/jdrafting/gui/controller/actions/ExtremesAction.java
+++ b/src/jdrafting/gui/controller/actions/ExtremesAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/EyedropperAction.java b/src/jdrafting/gui/controller/actions/EyedropperAction.java
index fe9b12c..3c84413 100644
--- a/src/jdrafting/gui/controller/actions/EyedropperAction.java
+++ b/src/jdrafting/gui/controller/actions/EyedropperAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/ForwardAction.java b/src/jdrafting/gui/controller/actions/ForwardAction.java
index dc2d5b3..555cb8b 100644
--- a/src/jdrafting/gui/controller/actions/ForwardAction.java
+++ b/src/jdrafting/gui/controller/actions/ForwardAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/FragmentAction.java b/src/jdrafting/gui/controller/actions/FragmentAction.java
index a59cd49..6132fa5 100644
--- a/src/jdrafting/gui/controller/actions/FragmentAction.java
+++ b/src/jdrafting/gui/controller/actions/FragmentAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/FreeHandAction.java b/src/jdrafting/gui/controller/actions/FreeHandAction.java
index 7df3e8c..2b6f4fe 100644
--- a/src/jdrafting/gui/controller/actions/FreeHandAction.java
+++ b/src/jdrafting/gui/controller/actions/FreeHandAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
@@ -23,7 +23,7 @@ public FreeHandAction( Application app )
{
this.app = app;
- putValue( NAME, Application.getLocaleText( "free_hand" ) );
+ putValue( NAME, getLocaleText( "free_hand" ) );
putValue( SHORT_DESCRIPTION, getLocaleText( "free_hand_des" ) );
putValue( MNEMONIC_KEY, KeyEvent.VK_F );
putValue( ACCELERATOR_KEY,
diff --git a/src/jdrafting/gui/controller/actions/FusionAction.java b/src/jdrafting/gui/controller/actions/FusionAction.java
index 2dc1c34..68c44fe 100644
--- a/src/jdrafting/gui/controller/actions/FusionAction.java
+++ b/src/jdrafting/gui/controller/actions/FusionAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/HomothetyAction.java b/src/jdrafting/gui/controller/actions/HomothetyAction.java
index 50f8ad0..44b5319 100644
--- a/src/jdrafting/gui/controller/actions/HomothetyAction.java
+++ b/src/jdrafting/gui/controller/actions/HomothetyAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
@@ -48,9 +48,8 @@ public void actionPerformed( ActionEvent e )
if ( app.getSelectedShapes().size() > 0 )
{
// dialog for homothety factor
- JSpinner spinFactor = new JSpinner(
- new SpinnerNumberModel(
- factor, .1, Double.POSITIVE_INFINITY, .1 ) );
+ JSpinner spinFactor = new JSpinner( new SpinnerNumberModel(
+ factor, 0.1, Double.POSITIVE_INFINITY, 0.1 ) );
spinFactor.addChangeListener( new ChangeListener() {
@Override
public void stateChanged( ChangeEvent e )
@@ -60,9 +59,9 @@ public void stateChanged( ChangeEvent e )
});
int option = JOptionPane.showOptionDialog( app, spinFactor,
- getLocaleText( "homo_dlg" ),
- JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE,
- Application.getLargeIcon( "homothety.png" ), null, null );
+ getLocaleText( "homo_dlg" ),
+ JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE,
+ getLargeIcon( "homothety.png" ), null, null );
if ( option != JOptionPane.OK_OPTION )
{
// back to select mode
diff --git a/src/jdrafting/gui/controller/actions/IntersectionsAction.java b/src/jdrafting/gui/controller/actions/IntersectionsAction.java
index 4d21ac5..872925f 100644
--- a/src/jdrafting/gui/controller/actions/IntersectionsAction.java
+++ b/src/jdrafting/gui/controller/actions/IntersectionsAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.BasicStroke;
import java.awt.Color;
diff --git a/src/jdrafting/gui/controller/actions/InvertSelectionAction.java b/src/jdrafting/gui/controller/actions/InvertSelectionAction.java
index 7e6fc01..544508e 100644
--- a/src/jdrafting/gui/controller/actions/InvertSelectionAction.java
+++ b/src/jdrafting/gui/controller/actions/InvertSelectionAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/MediatrixAction.java b/src/jdrafting/gui/controller/actions/MediatrixAction.java
index 0d2cc71..2a9029f 100644
--- a/src/jdrafting/gui/controller/actions/MediatrixAction.java
+++ b/src/jdrafting/gui/controller/actions/MediatrixAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/MidpointAction.java b/src/jdrafting/gui/controller/actions/MidpointAction.java
index f5fa79b..9889471 100644
--- a/src/jdrafting/gui/controller/actions/MidpointAction.java
+++ b/src/jdrafting/gui/controller/actions/MidpointAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/ModifySegmentAction.java b/src/jdrafting/gui/controller/actions/ModifySegmentAction.java
index c7b11dd..d3f34b4 100644
--- a/src/jdrafting/gui/controller/actions/ModifySegmentAction.java
+++ b/src/jdrafting/gui/controller/actions/ModifySegmentAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/MoveZBufferAction.java b/src/jdrafting/gui/controller/actions/MoveZBufferAction.java
index 51722bb..28c1e68 100644
--- a/src/jdrafting/gui/controller/actions/MoveZBufferAction.java
+++ b/src/jdrafting/gui/controller/actions/MoveZBufferAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/NewAction.java b/src/jdrafting/gui/controller/actions/NewAction.java
index 39682fa..0a6aebc 100644
--- a/src/jdrafting/gui/controller/actions/NewAction.java
+++ b/src/jdrafting/gui/controller/actions/NewAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/OpenAction.java b/src/jdrafting/gui/controller/actions/OpenAction.java
index a49fdd6..29b37b0 100644
--- a/src/jdrafting/gui/controller/actions/OpenAction.java
+++ b/src/jdrafting/gui/controller/actions/OpenAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.Dimension;
import java.awt.Graphics;
@@ -32,6 +32,7 @@
import jdrafting.Exercise;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
import jdrafting.gui.Viewport;
@SuppressWarnings("serial")
@@ -62,6 +63,7 @@ public OpenAction( Application app )
accesoryPanel.add( previewPanel );
fileChooser.setAccessory( accesoryPanel );
fileChooser.addPropertyChangeListener( previewPanel );
+ fileChooser.setPreferredSize( JDUtils.getScreenSize( 0.7f, 0.7f ) );
}
@Override
diff --git a/src/jdrafting/gui/controller/actions/ParallelAction.java b/src/jdrafting/gui/controller/actions/ParallelAction.java
index e27bffa..4911f11 100644
--- a/src/jdrafting/gui/controller/actions/ParallelAction.java
+++ b/src/jdrafting/gui/controller/actions/ParallelAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/PasteStyleAction.java b/src/jdrafting/gui/controller/actions/PasteStyleAction.java
index 32ba7ac..b784de7 100644
--- a/src/jdrafting/gui/controller/actions/PasteStyleAction.java
+++ b/src/jdrafting/gui/controller/actions/PasteStyleAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/PerpendicularAction.java b/src/jdrafting/gui/controller/actions/PerpendicularAction.java
index f5b2256..c382f46 100644
--- a/src/jdrafting/gui/controller/actions/PerpendicularAction.java
+++ b/src/jdrafting/gui/controller/actions/PerpendicularAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/PointAction.java b/src/jdrafting/gui/controller/actions/PointAction.java
index ecc3235..12f1fa0 100644
--- a/src/jdrafting/gui/controller/actions/PointAction.java
+++ b/src/jdrafting/gui/controller/actions/PointAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/PointColorAction.java b/src/jdrafting/gui/controller/actions/PointColorAction.java
index 1f8ac10..4801347 100644
--- a/src/jdrafting/gui/controller/actions/PointColorAction.java
+++ b/src/jdrafting/gui/controller/actions/PointColorAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
@@ -36,7 +36,7 @@ public PointColorAction( Application app )
jcc = new JColorChooser();
colorChooser = JColorChooser.createDialog(
- app, getLocaleText( "point_color_des" ), false, jcc,
+ app, getLocaleText( "point_color_des" ), true, jcc,
(evt) -> app.setPointColor( jcc.getColor() ), // ok
null ); // cancel
}
diff --git a/src/jdrafting/gui/controller/actions/PolyLineAction.java b/src/jdrafting/gui/controller/actions/PolyLineAction.java
index 217e2c0..ea308ec 100644
--- a/src/jdrafting/gui/controller/actions/PolyLineAction.java
+++ b/src/jdrafting/gui/controller/actions/PolyLineAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/PolygonAction.java b/src/jdrafting/gui/controller/actions/PolygonAction.java
index ce4915a..99d1e2c 100644
--- a/src/jdrafting/gui/controller/actions/PolygonAction.java
+++ b/src/jdrafting/gui/controller/actions/PolygonAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/ProtractorAction.java b/src/jdrafting/gui/controller/actions/ProtractorAction.java
index 1cff97a..88cb455 100644
--- a/src/jdrafting/gui/controller/actions/ProtractorAction.java
+++ b/src/jdrafting/gui/controller/actions/ProtractorAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/RectangleAction.java b/src/jdrafting/gui/controller/actions/RectangleAction.java
index 2aaaf71..82d34e8 100644
--- a/src/jdrafting/gui/controller/actions/RectangleAction.java
+++ b/src/jdrafting/gui/controller/actions/RectangleAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/RedoAction.java b/src/jdrafting/gui/controller/actions/RedoAction.java
index ca5c36e..4ad44a0 100644
--- a/src/jdrafting/gui/controller/actions/RedoAction.java
+++ b/src/jdrafting/gui/controller/actions/RedoAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/RewindAction.java b/src/jdrafting/gui/controller/actions/RewindAction.java
index d5e732c..d5d242e 100644
--- a/src/jdrafting/gui/controller/actions/RewindAction.java
+++ b/src/jdrafting/gui/controller/actions/RewindAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/RotationAction.java b/src/jdrafting/gui/controller/actions/RotationAction.java
index 268d4a6..97e4cfe 100644
--- a/src/jdrafting/gui/controller/actions/RotationAction.java
+++ b/src/jdrafting/gui/controller/actions/RotationAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/RulerAction.java b/src/jdrafting/gui/controller/actions/RulerAction.java
index 2c9c8e1..3271b1e 100644
--- a/src/jdrafting/gui/controller/actions/RulerAction.java
+++ b/src/jdrafting/gui/controller/actions/RulerAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/SaveAction.java b/src/jdrafting/gui/controller/actions/SaveAction.java
index d0f31f5..c284a3b 100644
--- a/src/jdrafting/gui/controller/actions/SaveAction.java
+++ b/src/jdrafting/gui/controller/actions/SaveAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
@@ -12,7 +12,6 @@
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Arrays;
-import java.util.stream.Stream;
import javax.swing.AbstractAction;
import javax.swing.JFileChooser;
@@ -22,6 +21,7 @@
import javax.swing.filechooser.FileNameExtensionFilter;
import jdrafting.gui.Application;
+import jdrafting.gui.JDUtils;
/**
* Save exercise to media in JDrafting format
@@ -71,8 +71,8 @@ public void actionPerformed(ActionEvent e)
fileChooser.setSelectedFile(
new File( "jd_" + ( counter++ ) + ".jd" ) );
else
- fileChooser.setSelectedFile(
- new File( camelCase( app.getExercise().getTitle() ) +".jd" ) );
+ fileChooser.setSelectedFile( new File(
+ JDUtils.camelCase( app.getExercise().getTitle() ) +".jd" ) );
String saveFilename = app.getSaveFilename();
@@ -103,22 +103,4 @@ public void actionPerformed(ActionEvent e)
app, ex, "Error while saving", JOptionPane.ERROR_MESSAGE );
}
}
-
- /**
- * Converts a name to a CamelCase string only with alphanumeric characters
- * @param name a name
- * @return CamelCase representation
- */
- public static String camelCase( String name )
- {
- String[] array = name.split( "[^a-zA-Z0-9]" );
- array = Stream.of( array )
- .filter( s -> !s.trim().isEmpty() )
- .map(
- s -> Character.toUpperCase( s.charAt( 0 ) ) + s.substring( 1 ) )
- .toArray( String[]::new );
- name = String.join( "", array );
-
- return name;
- }
}
diff --git a/src/jdrafting/gui/controller/actions/SaveImageAction.java b/src/jdrafting/gui/controller/actions/SaveImageAction.java
index 43c3baf..919ab79 100644
--- a/src/jdrafting/gui/controller/actions/SaveImageAction.java
+++ b/src/jdrafting/gui/controller/actions/SaveImageAction.java
@@ -3,9 +3,9 @@
import static jdrafting.gui.Application.APPNAME;
import static jdrafting.gui.Application.PROJECT_PAGE;
import static jdrafting.gui.Application.VERSION;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.Color;
import java.awt.Dimension;
@@ -49,6 +49,7 @@
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
import jdrafting.gui.Viewport;
@SuppressWarnings("serial")
@@ -75,6 +76,7 @@ public SaveImageAction( Application app )
// create static file chooser dialog
fileChooser = new ImageChooser();
+ fileChooser.setPreferredSize( JDUtils.getScreenSize( 0.8f, 0.8f ) );
}
@Override
@@ -101,7 +103,7 @@ public void actionPerformed( ActionEvent e )
fileChooser.setSelectedFile( new File( "jd_" + ( counter++ ) ) );
else
fileChooser.setSelectedFile( new File(
- SaveAction.camelCase( app.getExercise().getTitle() ) ) );
+ JDUtils.camelCase( app.getExercise().getTitle() ) ) );
// set fields
fileChooser.textHeight.setText(
String.valueOf( getAutomaticHeight( 1000 ) ) );
diff --git a/src/jdrafting/gui/controller/actions/SegmentAction.java b/src/jdrafting/gui/controller/actions/SegmentAction.java
index ac55575..0c0dab6 100644
--- a/src/jdrafting/gui/controller/actions/SegmentAction.java
+++ b/src/jdrafting/gui/controller/actions/SegmentAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/SelectAllAction.java b/src/jdrafting/gui/controller/actions/SelectAllAction.java
index 6cdb945..e2088d2 100644
--- a/src/jdrafting/gui/controller/actions/SelectAllAction.java
+++ b/src/jdrafting/gui/controller/actions/SelectAllAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/SelectionAction.java b/src/jdrafting/gui/controller/actions/SelectionAction.java
index 097f596..9812367 100644
--- a/src/jdrafting/gui/controller/actions/SelectionAction.java
+++ b/src/jdrafting/gui/controller/actions/SelectionAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/ShapeColorAction.java b/src/jdrafting/gui/controller/actions/ShapeColorAction.java
index f866d27..0234d26 100644
--- a/src/jdrafting/gui/controller/actions/ShapeColorAction.java
+++ b/src/jdrafting/gui/controller/actions/ShapeColorAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
@@ -36,7 +36,7 @@ public ShapeColorAction( Application app )
jcc = new JColorChooser();
colorChooser = JColorChooser.createDialog(
- app, getLocaleText( "color_des" ), false, jcc,
+ app, getLocaleText( "color_des" ), true, jcc,
(evt) -> app.setColor( jcc.getColor() ), // ok
null ); // cancel
}
diff --git a/src/jdrafting/gui/controller/actions/SplineAction.java b/src/jdrafting/gui/controller/actions/SplineAction.java
index b20e39c..9cba5d6 100644
--- a/src/jdrafting/gui/controller/actions/SplineAction.java
+++ b/src/jdrafting/gui/controller/actions/SplineAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/TextVisibleAction.java b/src/jdrafting/gui/controller/actions/TextVisibleAction.java
index 988658b..193fb34 100644
--- a/src/jdrafting/gui/controller/actions/TextVisibleAction.java
+++ b/src/jdrafting/gui/controller/actions/TextVisibleAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/TranslationAction.java b/src/jdrafting/gui/controller/actions/TranslationAction.java
index f8189b6..6babc6c 100644
--- a/src/jdrafting/gui/controller/actions/TranslationAction.java
+++ b/src/jdrafting/gui/controller/actions/TranslationAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/UndoAction.java b/src/jdrafting/gui/controller/actions/UndoAction.java
index f0c1d4d..1d9479f 100644
--- a/src/jdrafting/gui/controller/actions/UndoAction.java
+++ b/src/jdrafting/gui/controller/actions/UndoAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/VertexAction.java b/src/jdrafting/gui/controller/actions/VertexAction.java
index dedfe3f..1ceb254 100644
--- a/src/jdrafting/gui/controller/actions/VertexAction.java
+++ b/src/jdrafting/gui/controller/actions/VertexAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
diff --git a/src/jdrafting/gui/controller/actions/ZoomAllAction.java b/src/jdrafting/gui/controller/actions/ZoomAllAction.java
index 8408ece..6a80781 100644
--- a/src/jdrafting/gui/controller/actions/ZoomAllAction.java
+++ b/src/jdrafting/gui/controller/actions/ZoomAllAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
diff --git a/src/jdrafting/gui/controller/actions/ZoomInOutAction.java b/src/jdrafting/gui/controller/actions/ZoomInOutAction.java
index b75d0f0..64c0565 100644
--- a/src/jdrafting/gui/controller/actions/ZoomInOutAction.java
+++ b/src/jdrafting/gui/controller/actions/ZoomInOutAction.java
@@ -1,8 +1,8 @@
package jdrafting.gui.controller.actions;
-import static jdrafting.gui.Application.getLargeIcon;
-import static jdrafting.gui.Application.getLocaleText;
-import static jdrafting.gui.Application.getSmallIcon;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
+import static jdrafting.gui.JDUtils.getSmallIcon;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
diff --git a/src/jdrafting/gui/controller/mouse/AngleListener.java b/src/jdrafting/gui/controller/mouse/AngleListener.java
index 2dda530..81be866 100644
--- a/src/jdrafting/gui/controller/mouse/AngleListener.java
+++ b/src/jdrafting/gui/controller/mouse/AngleListener.java
@@ -3,7 +3,7 @@
import static jdrafting.geom.JDMath.pointRelativeToCenter;
import static jdrafting.geom.JDMath.projection;
import static jdrafting.geom.JDMath.vector;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -19,6 +19,7 @@
import jdrafting.geom.JDMath;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Create segment by angle using mouse control
@@ -26,7 +27,7 @@
public class AngleListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "angle_cursor.png" );
+ JDUtils.getCustomCursor( "angle_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/ArcListener.java b/src/jdrafting/gui/controller/mouse/ArcListener.java
index d6e7968..e7abc09 100644
--- a/src/jdrafting/gui/controller/mouse/ArcListener.java
+++ b/src/jdrafting/gui/controller/mouse/ArcListener.java
@@ -5,7 +5,7 @@
import static jdrafting.geom.JDMath.sumVectors;
import static jdrafting.geom.JDMath.vector;
import static jdrafting.geom.JDMath.vectorArg;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -21,6 +21,7 @@
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Creates an arc using mouse control
@@ -28,7 +29,7 @@
public class ArcListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "arc_cursor.png" );
+ JDUtils.getCustomCursor( "arc_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/ArrowListener.java b/src/jdrafting/gui/controller/mouse/ArrowListener.java
index e4299c5..cbbd99d 100644
--- a/src/jdrafting/gui/controller/mouse/ArrowListener.java
+++ b/src/jdrafting/gui/controller/mouse/ArrowListener.java
@@ -6,7 +6,7 @@
import static jdrafting.geom.JDMath.sumVectors;
import static jdrafting.geom.JDMath.vector;
import static jdrafting.geom.JDMath.vectorArg;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
@@ -17,6 +17,7 @@
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Create an arrow using mouse control
@@ -24,7 +25,7 @@
public class ArrowListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "arrow_cursor.png" );
+ JDUtils.getCustomCursor( "arrow_cursor.png" );
private static final double ANGLE_INTERVAL = PI / 4.;
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/AxialSymmetryListener.java b/src/jdrafting/gui/controller/mouse/AxialSymmetryListener.java
index 388e9ff..cb94828 100644
--- a/src/jdrafting/gui/controller/mouse/AxialSymmetryListener.java
+++ b/src/jdrafting/gui/controller/mouse/AxialSymmetryListener.java
@@ -1,6 +1,6 @@
package jdrafting.gui.controller.mouse;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -24,6 +24,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Axial symmetry of selected shapes using mouse control
@@ -31,7 +32,7 @@
public class AxialSymmetryListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "axial_symmetry_cursor.png" );
+ JDUtils.getCustomCursor( "axial_symmetry_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/BisectrixListener.java b/src/jdrafting/gui/controller/mouse/BisectrixListener.java
index 6c35231..82aa262 100644
--- a/src/jdrafting/gui/controller/mouse/BisectrixListener.java
+++ b/src/jdrafting/gui/controller/mouse/BisectrixListener.java
@@ -1,11 +1,12 @@
package jdrafting.gui.controller.mouse;
import static jdrafting.geom.JDMath.linesIntersection;
+import static jdrafting.geom.JDMath.normal;
import static jdrafting.geom.JDMath.pointRelativeToCenter;
import static jdrafting.geom.JDMath.sumVectors;
import static jdrafting.geom.JDMath.vector;
-import static jdrafting.geom.JDMath.normal;
import static jdrafting.geom.JDMath.vectorArg;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
@@ -21,6 +22,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Create bisectrix segment using mouse control
@@ -28,7 +30,7 @@
public class BisectrixListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "bisectrix_cursor.png" );
+ JDUtils.getCustomCursor( "bisectrix_cursor.png" );
private CanvasPanel canvas;
private Application app;
@@ -44,7 +46,7 @@ public BisectrixListener( CanvasPanel canvas )
canvas.setCursor( CURSOR );
- app.setStatusText( Application.getLocaleText( "txt_bisectrix1" ) );
+ app.setStatusText( getLocaleText( "txt_bisectrix1" ) );
}
@Override
@@ -82,8 +84,7 @@ public void mouseReleased( MouseEvent e )
{
seg1 = jdshape;
canvas.setCursor( CURSOR );
- app.setStatusText(
- Application.getLocaleText( "txt_bisectrix2" ) );
+ app.setStatusText( getLocaleText( "txt_bisectrix2" ) );
}
else
return;
@@ -101,17 +102,16 @@ else if ( seg2 == null )
{
// error message
JOptionPane.showMessageDialog( app,
- Application.getLocaleText( "bisectrix_dlg" ),
- Application.getLocaleText( "bisectrix_title" ),
- JOptionPane.ERROR_MESSAGE );
+ getLocaleText( "bisectrix_dlg" ),
+ getLocaleText( "bisectrix_title" ),
+ JOptionPane.ERROR_MESSAGE );
// back to select mode
canvas.setCanvasListener( new HandListener( canvas ) );
return;
}
canvas.setCursor( CURSOR );
- app.setStatusText(
- Application.getLocaleText( "txt_bisectrix3" ) );
+ app.setStatusText( getLocaleText( "txt_bisectrix3" ) );
}
else
return;
@@ -120,13 +120,13 @@ else if ( bis1 == null )
{
Line2D bisectrix = getBisectrix( logicMouse );
bis1 = bisectrix.getP2();
- app.setStatusText( Application.getLocaleText( "txt_bisectrix4" ) );
+ app.setStatusText( getLocaleText( "txt_bisectrix4" ) );
}
else
{
Line2D bisectrix = getBisectrix( logicMouse );
app.addShapeFromIterator( bisectrix.getPathIterator( null ), "",
- "> " + Application.getLocaleText( "new_bisectrix" )
+ "> " + getLocaleText( "new_bisectrix" )
+ " [" + seg1.getName() + "," + seg2.getName() + "]",
app.getColor(), app.getStroke() );
diff --git a/src/jdrafting/gui/controller/mouse/BoundsListener.java b/src/jdrafting/gui/controller/mouse/BoundsListener.java
index c0b33df..f40323c 100644
--- a/src/jdrafting/gui/controller/mouse/BoundsListener.java
+++ b/src/jdrafting/gui/controller/mouse/BoundsListener.java
@@ -1,6 +1,6 @@
package jdrafting.gui.controller.mouse;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
@@ -10,6 +10,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Create a rectangle bounds for a shape by mouse control
@@ -17,7 +18,7 @@
public class BoundsListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "bounds_cursor.png" );
+ JDUtils.getCustomCursor( "bounds_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/CapableArcListener.java b/src/jdrafting/gui/controller/mouse/CapableArcListener.java
index 7640b4a..7122ac5 100644
--- a/src/jdrafting/gui/controller/mouse/CapableArcListener.java
+++ b/src/jdrafting/gui/controller/mouse/CapableArcListener.java
@@ -7,6 +7,7 @@
import static jdrafting.geom.JDMath.sumVectors;
import static jdrafting.geom.JDMath.vector;
import static jdrafting.geom.JDMath.vectorArg;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
@@ -21,6 +22,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Create capable arc of a segment using mouse control
@@ -28,7 +30,7 @@
public class CapableArcListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "capable_arc_cursor.png" );
+ JDUtils.getCustomCursor( "capable_arc_cursor.png" );
private CanvasPanel canvas;
private Application app;
@@ -43,7 +45,7 @@ public CapableArcListener( CanvasPanel canvas )
canvas.setCursor( CURSOR );
- app.setStatusText( Application.getLocaleText( "txt_cap1" ) );
+ app.setStatusText( getLocaleText( "txt_cap1" ) );
}
@Override
@@ -82,7 +84,7 @@ public void mouseReleased( MouseEvent e )
{
segment = jdshape;
canvas.setCursor( CURSOR );
- app.setStatusText( Application.getLocaleText( "txt_cap2" ) );
+ app.setStatusText( getLocaleText( "txt_cap2" ) );
canvas.repaint();
}
}
@@ -94,7 +96,7 @@ public void mouseReleased( MouseEvent e )
double flatness = arc.getWidth() / app.getFlatnessValue();
app.addShapeFromIterator( arc.getPathIterator( null, flatness ), "",
- "> " + Application.getLocaleText( "new_capable_arc" )
+ "> " + getLocaleText( "new_capable_arc" )
+ " [" + segment.getName() + "]",
app.getColor(), app.getStroke() );
diff --git a/src/jdrafting/gui/controller/mouse/CentralSymmetryListener.java b/src/jdrafting/gui/controller/mouse/CentralSymmetryListener.java
index 5826d05..5b0eaf7 100644
--- a/src/jdrafting/gui/controller/mouse/CentralSymmetryListener.java
+++ b/src/jdrafting/gui/controller/mouse/CentralSymmetryListener.java
@@ -1,7 +1,7 @@
package jdrafting.gui.controller.mouse;
import static jdrafting.geom.JDMath.nearInt;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -23,6 +23,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Central symmety on selected shapes using mouse control
@@ -30,7 +31,7 @@
public class CentralSymmetryListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "central_symmetry_cursor.png" );
+ JDUtils.getCustomCursor( "central_symmetry_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/CircumferenceListener.java b/src/jdrafting/gui/controller/mouse/CircumferenceListener.java
index e4221f9..0a65c82 100644
--- a/src/jdrafting/gui/controller/mouse/CircumferenceListener.java
+++ b/src/jdrafting/gui/controller/mouse/CircumferenceListener.java
@@ -1,6 +1,6 @@
package jdrafting.gui.controller.mouse;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
import java.awt.Graphics2D;
@@ -16,11 +16,12 @@
import jdrafting.geom.JDPoint;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class CircumferenceListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "circumference_cursor.png" );
+ JDUtils.getCustomCursor( "circumference_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/DivisionPointsListener.java b/src/jdrafting/gui/controller/mouse/DivisionPointsListener.java
index a094508..5494562 100644
--- a/src/jdrafting/gui/controller/mouse/DivisionPointsListener.java
+++ b/src/jdrafting/gui/controller/mouse/DivisionPointsListener.java
@@ -4,7 +4,8 @@
import static jdrafting.geom.JDMath.length;
import static jdrafting.geom.JDMath.sumVectors;
import static jdrafting.geom.JDMath.vector;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -26,11 +27,12 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class DivisionPointsListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "divisions_cursor.png" );
+ JDUtils.getCustomCursor( "divisions_cursor.png" );
private CanvasPanel canvas;
private Application app;
@@ -87,7 +89,7 @@ public void stateChanged( ChangeEvent e )
int option = JOptionPane.showOptionDialog( app, spinDivisions,
getLocaleText( "div_dlg" ),
JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE,
- Application.getLargeIcon( "divisions.png" ), null, null );
+ getLargeIcon( "divisions.png" ), null, null );
if ( option == JOptionPane.CANCEL_OPTION
|| option == JOptionPane.CLOSED_OPTION )
{
diff --git a/src/jdrafting/gui/controller/mouse/EllipseListener.java b/src/jdrafting/gui/controller/mouse/EllipseListener.java
index 86ac9ec..ca40ef3 100644
--- a/src/jdrafting/gui/controller/mouse/EllipseListener.java
+++ b/src/jdrafting/gui/controller/mouse/EllipseListener.java
@@ -1,6 +1,6 @@
package jdrafting.gui.controller.mouse;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
@@ -18,11 +18,12 @@
import jdrafting.geom.JDPoint;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class EllipseListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "ellipse_cursor.png" );
+ JDUtils.getCustomCursor( "ellipse_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/ExtremesListener.java b/src/jdrafting/gui/controller/mouse/ExtremesListener.java
index 17448ae..3e42ad4 100644
--- a/src/jdrafting/gui/controller/mouse/ExtremesListener.java
+++ b/src/jdrafting/gui/controller/mouse/ExtremesListener.java
@@ -1,6 +1,6 @@
package jdrafting.gui.controller.mouse;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -18,11 +18,12 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class ExtremesListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "extremes_cursor.png" );
+ JDUtils.getCustomCursor( "extremes_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/EyedropperListener.java b/src/jdrafting/gui/controller/mouse/EyedropperListener.java
index 4633627..b0ec7a4 100644
--- a/src/jdrafting/gui/controller/mouse/EyedropperListener.java
+++ b/src/jdrafting/gui/controller/mouse/EyedropperListener.java
@@ -9,11 +9,12 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class EyedropperListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "eyedropper_cursor.png" );
+ JDUtils.getCustomCursor( "eyedropper_cursor.png" );
private Application app;
private CanvasPanel canvas;
@@ -24,7 +25,7 @@ public EyedropperListener( CanvasPanel canvas )
this.canvas = canvas;
app = canvas.getApplication();
- app.setStatusText( Application.getLocaleText( "txt_eyedropper" ) );
+ app.setStatusText( JDUtils.getLocaleText( "txt_eyedropper" ) );
}
@Override
diff --git a/src/jdrafting/gui/controller/mouse/FragmentListener.java b/src/jdrafting/gui/controller/mouse/FragmentListener.java
index 54303a2..b0d8740 100644
--- a/src/jdrafting/gui/controller/mouse/FragmentListener.java
+++ b/src/jdrafting/gui/controller/mouse/FragmentListener.java
@@ -1,6 +1,6 @@
package jdrafting.gui.controller.mouse;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -14,11 +14,12 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class FragmentListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "hammer_cursor.png" );
+ JDUtils.getCustomCursor( "hammer_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/FreeHandListener.java b/src/jdrafting/gui/controller/mouse/FreeHandListener.java
index cfd65c2..62f95c7 100644
--- a/src/jdrafting/gui/controller/mouse/FreeHandListener.java
+++ b/src/jdrafting/gui/controller/mouse/FreeHandListener.java
@@ -9,13 +9,14 @@
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class FreeHandListener extends AbstractCanvasMouseListener
{
private static final Cursor UP_CURSOR =
- CanvasPanel.getCustomCursor( "free_hand_up_cursor.png" );
+ JDUtils.getCustomCursor( "free_hand_up_cursor.png" );
private static final Cursor DOWN_CURSOR =
- CanvasPanel.getCustomCursor( "free_hand_down_cursor.png" );
+ JDUtils.getCustomCursor( "free_hand_down_cursor.png" );
private CanvasPanel canvas;
private Application app;
@@ -33,7 +34,7 @@ public FreeHandListener( CanvasPanel canvas )
canvas.setCursor( UP_CURSOR );
- app.setStatusText( Application.getLocaleText( "txt_free1" ) );
+ app.setStatusText( JDUtils.getLocaleText( "txt_free1" ) );
}
@Override
diff --git a/src/jdrafting/gui/controller/mouse/HandListener.java b/src/jdrafting/gui/controller/mouse/HandListener.java
index e5e5227..9187a14 100644
--- a/src/jdrafting/gui/controller/mouse/HandListener.java
+++ b/src/jdrafting/gui/controller/mouse/HandListener.java
@@ -21,13 +21,14 @@
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
import jdrafting.gui.EditShapeDialog;
+import jdrafting.gui.JDUtils;
public class HandListener extends AbstractCanvasMouseListener
{
private static final Cursor DRAG_CURSOR =
- CanvasPanel.getCustomCursor( "dragging_cursor.png" );
+ JDUtils.getCustomCursor( "dragging_cursor.png" );
private static final Cursor HAND_CURSOR =
- CanvasPanel.getCustomCursor( "hand_cursor.png" );
+ JDUtils.getCustomCursor( "hand_cursor.png" );
private CanvasPanel canvas;
private Application app;
@@ -35,7 +36,7 @@ public class HandListener extends AbstractCanvasMouseListener
// drag parameters
private int newMouseX, newMouseY;
- private boolean moving = false;
+ public boolean moving = false;
private int button = -1; // (mousedragged doesn't keep pressed button)
public HandListener( CanvasPanel canvas )
@@ -47,7 +48,7 @@ public HandListener( CanvasPanel canvas )
canvas.setCursor( HAND_CURSOR );
- app.setStatusText( Application.getLocaleText( "txt_hand" ) );
+ app.setStatusText( JDUtils.getLocaleText( "txt_hand" ) );
}
@Override
diff --git a/src/jdrafting/gui/controller/mouse/HomothetyListener.java b/src/jdrafting/gui/controller/mouse/HomothetyListener.java
index d921808..009bac6 100644
--- a/src/jdrafting/gui/controller/mouse/HomothetyListener.java
+++ b/src/jdrafting/gui/controller/mouse/HomothetyListener.java
@@ -1,7 +1,7 @@
package jdrafting.gui.controller.mouse;
import static jdrafting.geom.JDMath.nearInt;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -27,6 +27,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Apply homothety to selected shapes using mouse control
@@ -34,7 +35,7 @@
public class HomothetyListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "homothety_cursor.png" );
+ JDUtils.getCustomCursor( "homothety_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/MediatrixListener.java b/src/jdrafting/gui/controller/mouse/MediatrixListener.java
index d8ec988..ddd96e5 100644
--- a/src/jdrafting/gui/controller/mouse/MediatrixListener.java
+++ b/src/jdrafting/gui/controller/mouse/MediatrixListener.java
@@ -1,6 +1,6 @@
package jdrafting.gui.controller.mouse;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import static jdrafting.geom.JDMath.linesIntersection;
import static jdrafting.geom.JDMath.midpoint;
import static jdrafting.geom.JDMath.normal;
@@ -18,6 +18,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Creates a mediatrix segment using mouse control
@@ -25,7 +26,7 @@
public class MediatrixListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "mediatrix_cursor.png" );
+ JDUtils.getCustomCursor( "mediatrix_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/MidpointListener.java b/src/jdrafting/gui/controller/mouse/MidpointListener.java
index e9b9992..d3cd969 100644
--- a/src/jdrafting/gui/controller/mouse/MidpointListener.java
+++ b/src/jdrafting/gui/controller/mouse/MidpointListener.java
@@ -1,7 +1,7 @@
package jdrafting.gui.controller.mouse;
import static jdrafting.geom.JDMath.centroid;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -15,11 +15,12 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class MidpointListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "midpoint_cursor.png" );
+ JDUtils.getCustomCursor( "midpoint_cursor.png" );
private Application app;
private CanvasPanel canvas;
diff --git a/src/jdrafting/gui/controller/mouse/ModifySegmentListener.java b/src/jdrafting/gui/controller/mouse/ModifySegmentListener.java
index 5ae95d8..f95fad9 100644
--- a/src/jdrafting/gui/controller/mouse/ModifySegmentListener.java
+++ b/src/jdrafting/gui/controller/mouse/ModifySegmentListener.java
@@ -4,7 +4,7 @@
import static jdrafting.geom.JDMath.normal;
import static jdrafting.geom.JDMath.sumVectors;
import static jdrafting.geom.JDMath.vector;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -20,6 +20,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Modifies a segment using mouse control
@@ -27,7 +28,7 @@
public class ModifySegmentListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "modify_segment_cursor.png" );
+ JDUtils.getCustomCursor( "modify_segment_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/ParallelListener.java b/src/jdrafting/gui/controller/mouse/ParallelListener.java
index ef2f316..3195110 100644
--- a/src/jdrafting/gui/controller/mouse/ParallelListener.java
+++ b/src/jdrafting/gui/controller/mouse/ParallelListener.java
@@ -6,7 +6,7 @@
import static jdrafting.geom.JDMath.normal;
import static jdrafting.geom.JDMath.sumVectors;
import static jdrafting.geom.JDMath.vector;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
@@ -19,11 +19,12 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class ParallelListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "parallel_cursor.png" );
+ JDUtils.getCustomCursor( "parallel_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/PasteStyleListener.java b/src/jdrafting/gui/controller/mouse/PasteStyleListener.java
index fd7e6e1..5cdb62a 100644
--- a/src/jdrafting/gui/controller/mouse/PasteStyleListener.java
+++ b/src/jdrafting/gui/controller/mouse/PasteStyleListener.java
@@ -13,11 +13,12 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class PasteStyleListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "paste_style_cursor.png" );
+ JDUtils.getCustomCursor( "paste_style_cursor.png" );
private Application app;
private CanvasPanel canvas;
@@ -28,7 +29,7 @@ public PasteStyleListener( CanvasPanel canvas )
this.canvas = canvas;
app = canvas.getApplication();
- app.setStatusText( Application.getLocaleText( "txt_paste_style1" ) );
+ app.setStatusText( JDUtils.getLocaleText( "txt_paste_style1" ) );
}
@Override
diff --git a/src/jdrafting/gui/controller/mouse/PerpendicularListener.java b/src/jdrafting/gui/controller/mouse/PerpendicularListener.java
index 8398405..e661786 100644
--- a/src/jdrafting/gui/controller/mouse/PerpendicularListener.java
+++ b/src/jdrafting/gui/controller/mouse/PerpendicularListener.java
@@ -4,7 +4,7 @@
import static jdrafting.geom.JDMath.normal;
import static jdrafting.geom.JDMath.sumVectors;
import static jdrafting.geom.JDMath.vector;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
@@ -17,6 +17,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Creates a perpendicular segment using mouse control
@@ -24,7 +25,7 @@
public class PerpendicularListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "perpendicular_cursor.png" );
+ JDUtils.getCustomCursor( "perpendicular_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/PointListener.java b/src/jdrafting/gui/controller/mouse/PointListener.java
index 167d5ba..252e3a4 100644
--- a/src/jdrafting/gui/controller/mouse/PointListener.java
+++ b/src/jdrafting/gui/controller/mouse/PointListener.java
@@ -10,11 +10,12 @@
import jdrafting.geom.JDPoint;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class PointListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "point_cursor.png" );
+ JDUtils.getCustomCursor( "point_cursor.png" );
private CanvasPanel canvas;
private Application app;
@@ -27,7 +28,7 @@ public PointListener( CanvasPanel canvas )
canvas.setCursor( CURSOR );
- app.setStatusText( Application.getLocaleText( "txt_point" ) );
+ app.setStatusText( JDUtils.getLocaleText( "txt_point" ) );
}
@Override
diff --git a/src/jdrafting/gui/controller/mouse/PolygonListener.java b/src/jdrafting/gui/controller/mouse/PolygonListener.java
index e9d3cd2..ea7d23e 100644
--- a/src/jdrafting/gui/controller/mouse/PolygonListener.java
+++ b/src/jdrafting/gui/controller/mouse/PolygonListener.java
@@ -12,6 +12,7 @@
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Creates a polygon or polyline using mouse control
@@ -19,9 +20,9 @@
public class PolygonListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR_POLYGON =
- CanvasPanel.getCustomCursor( "polygon_cursor.png" );
+ JDUtils.getCustomCursor( "polygon_cursor.png" );
private static final Cursor CURSOR_POLYLINE =
- CanvasPanel.getCustomCursor( "polyline_cursor.png" );
+ JDUtils.getCustomCursor( "polyline_cursor.png" );
private final Cursor CURSOR;
private CanvasPanel canvas;
private Application app;
@@ -41,7 +42,7 @@ public PolygonListener( CanvasPanel canvas, boolean closed )
CURSOR = closed ? CURSOR_POLYGON : CURSOR_POLYLINE;
canvas.setCursor( CURSOR );
- app.setStatusText( Application.getLocaleText( "txt_poly" ) );
+ app.setStatusText( JDUtils.getLocaleText( "txt_poly" ) );
}
@Override
diff --git a/src/jdrafting/gui/controller/mouse/ProtractorListener.java b/src/jdrafting/gui/controller/mouse/ProtractorListener.java
index 4eb4792..e4973d0 100644
--- a/src/jdrafting/gui/controller/mouse/ProtractorListener.java
+++ b/src/jdrafting/gui/controller/mouse/ProtractorListener.java
@@ -1,6 +1,7 @@
package jdrafting.gui.controller.mouse;
import static jdrafting.geom.JDMath.lineAng;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -15,6 +16,7 @@
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Capture an angle using mouse control
@@ -22,7 +24,7 @@
public class ProtractorListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "protractor_cursor.png" );
+ JDUtils.getCustomCursor( "protractor_cursor.png" );
private CanvasPanel canvas;
private Application app;
@@ -37,7 +39,7 @@ public ProtractorListener( CanvasPanel canvas )
canvas.setCursor( CURSOR );
- app.setStatusText( Application.getLocaleText( "txt_prot1" ) );
+ app.setStatusText( getLocaleText( "txt_prot1" ) );
}
@Override
@@ -61,13 +63,13 @@ public void mouseReleased( MouseEvent e )
if ( vertex == null )
{
vertex = logicMouse;
- app.setStatusText( Application.getLocaleText( "txt_prot2" ) );
+ app.setStatusText( getLocaleText( "txt_prot2" ) );
}
// put first angle side
else if ( p1 == null )
{
p1 = logicMouse;
- app.setStatusText( Application.getLocaleText( "txt_prot3" ) );
+ app.setStatusText( getLocaleText( "txt_prot3" ) );
}
// put second angle side
else
diff --git a/src/jdrafting/gui/controller/mouse/RectangleListener.java b/src/jdrafting/gui/controller/mouse/RectangleListener.java
index 60d1990..9f9773b 100644
--- a/src/jdrafting/gui/controller/mouse/RectangleListener.java
+++ b/src/jdrafting/gui/controller/mouse/RectangleListener.java
@@ -1,6 +1,6 @@
package jdrafting.gui.controller.mouse;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
@@ -11,6 +11,7 @@
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Create a rectangle by mouse control
@@ -18,7 +19,7 @@
public class RectangleListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "rectangle_cursor.png" );
+ JDUtils.getCustomCursor( "rectangle_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/RotationListener.java b/src/jdrafting/gui/controller/mouse/RotationListener.java
index 3b8bb37..dcf17c4 100644
--- a/src/jdrafting/gui/controller/mouse/RotationListener.java
+++ b/src/jdrafting/gui/controller/mouse/RotationListener.java
@@ -5,7 +5,7 @@
import static java.lang.Math.toDegrees;
import static java.lang.Math.toRadians;
import static jdrafting.geom.JDMath.nearInt;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -28,6 +28,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Rotate selected shapes using mouse control
@@ -35,7 +36,7 @@
public class RotationListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "rotation_cursor.png" );
+ JDUtils.getCustomCursor( "rotation_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/RulerListener.java b/src/jdrafting/gui/controller/mouse/RulerListener.java
index 2e2ece6..d19b199 100644
--- a/src/jdrafting/gui/controller/mouse/RulerListener.java
+++ b/src/jdrafting/gui/controller/mouse/RulerListener.java
@@ -1,6 +1,6 @@
package jdrafting.gui.controller.mouse;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
@@ -11,11 +11,12 @@
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class RulerListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "ruler_cursor.png" );
+ JDUtils.getCustomCursor( "ruler_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/SegmentListener.java b/src/jdrafting/gui/controller/mouse/SegmentListener.java
index e980e4a..3ab4a27 100644
--- a/src/jdrafting/gui/controller/mouse/SegmentListener.java
+++ b/src/jdrafting/gui/controller/mouse/SegmentListener.java
@@ -4,7 +4,7 @@
import static jdrafting.geom.JDMath.pointRelativeToCenter;
import static jdrafting.geom.JDMath.sumVectors;
import static jdrafting.geom.JDMath.vector;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Cursor;
@@ -18,6 +18,7 @@
import jdrafting.geom.JDPoint;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Create a segment using mouse control
@@ -25,7 +26,7 @@
public class SegmentListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "segment_cursor.png" );
+ JDUtils.getCustomCursor( "segment_cursor.png" );
private static final double ANGLE_INTERVAL = Math.PI / 4.;
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/SelectionListener.java b/src/jdrafting/gui/controller/mouse/SelectionListener.java
index 3502c21..8628c87 100644
--- a/src/jdrafting/gui/controller/mouse/SelectionListener.java
+++ b/src/jdrafting/gui/controller/mouse/SelectionListener.java
@@ -14,6 +14,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Rectangular selection by mouse control
@@ -36,7 +37,7 @@ public SelectionListener( CanvasPanel canvas )
canvas.setCursor( new Cursor( Cursor.CROSSHAIR_CURSOR ) );
- app.setStatusText( Application.getLocaleText( "txt_sel1" ) );
+ app.setStatusText( JDUtils.getLocaleText( "txt_sel1" ) );
}
@Override
diff --git a/src/jdrafting/gui/controller/mouse/SplineListener.java b/src/jdrafting/gui/controller/mouse/SplineListener.java
index 90ee363..70dcdbe 100644
--- a/src/jdrafting/gui/controller/mouse/SplineListener.java
+++ b/src/jdrafting/gui/controller/mouse/SplineListener.java
@@ -20,6 +20,7 @@
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Creates a cubic spline using mouse control
@@ -27,7 +28,7 @@
public class SplineListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "spline_cursor.png" );
+ JDUtils.getCustomCursor( "spline_cursor.png" );
private CanvasPanel canvas;
private Application app;
@@ -42,7 +43,7 @@ public SplineListener( CanvasPanel canvas )
canvas.setCursor( CURSOR );
- app.setStatusText( Application.getLocaleText( "txt_poly" ) );
+ app.setStatusText( JDUtils.getLocaleText( "txt_poly" ) );
}
@Override
diff --git a/src/jdrafting/gui/controller/mouse/TranslationListener.java b/src/jdrafting/gui/controller/mouse/TranslationListener.java
index a4a4387..9f52257 100644
--- a/src/jdrafting/gui/controller/mouse/TranslationListener.java
+++ b/src/jdrafting/gui/controller/mouse/TranslationListener.java
@@ -3,7 +3,7 @@
import static jdrafting.geom.JDMath.adjustVectorToSize;
import static jdrafting.geom.JDMath.sumVectors;
import static jdrafting.geom.JDMath.vector;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -26,6 +26,7 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
/**
* Translate selected shapes using mouse control
@@ -33,7 +34,7 @@
public class TranslationListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "translation_cursor.png" );
+ JDUtils.getCustomCursor( "translation_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/gui/controller/mouse/VertexListener.java b/src/jdrafting/gui/controller/mouse/VertexListener.java
index c2a7487..346e158 100644
--- a/src/jdrafting/gui/controller/mouse/VertexListener.java
+++ b/src/jdrafting/gui/controller/mouse/VertexListener.java
@@ -1,6 +1,6 @@
package jdrafting.gui.controller.mouse;
-import static jdrafting.gui.Application.getLocaleText;
+import static jdrafting.gui.JDUtils.getLocaleText;
import java.awt.BasicStroke;
import java.awt.Color;
@@ -15,11 +15,12 @@
import jdrafting.geom.JDraftingShape;
import jdrafting.gui.Application;
import jdrafting.gui.CanvasPanel;
+import jdrafting.gui.JDUtils;
public class VertexListener extends AbstractCanvasMouseListener
{
private static final Cursor CURSOR =
- CanvasPanel.getCustomCursor( "vertex_cursor.png" );
+ JDUtils.getCustomCursor( "vertex_cursor.png" );
private CanvasPanel canvas;
private Application app;
diff --git a/src/jdrafting/resources/language/language.properties b/src/jdrafting/resources/language/language.properties
index 393724f..a9ec999 100644
--- a/src/jdrafting/resources/language/language.properties
+++ b/src/jdrafting/resources/language/language.properties
@@ -1,5 +1,5 @@
// general
-app_des=is an open source drafting application to design small Technical Drawing sketches
+app_des=is an open-source drafting application to design small Technical Drawing sketches.
This application is inspired by the 'Classical Construction',
also known as 'Ruler-and-compass Construction' or 'Compass-and-straightedge construction'.
However, another drawing tools can be used.
(More info about classical construction: Wikipedia)
width=Width
height=Height
degrees=deg
@@ -147,6 +147,8 @@ view=View
appearance=Appearance
help=Help
+item_style=Show/hide style bar
+item_ruler_prot=Show/hide ruler&protractor bar
item_status=Show/hide status bar
item_action=Show/hide action bar
item_shape=Show/hide shape bar
diff --git a/src/jdrafting/resources/language/language_en.properties b/src/jdrafting/resources/language/language_en.properties
index 393724f..a9ec999 100644
--- a/src/jdrafting/resources/language/language_en.properties
+++ b/src/jdrafting/resources/language/language_en.properties
@@ -1,5 +1,5 @@
// general
-app_des=is an open source drafting application to design small Technical Drawing sketches
+app_des=is an open-source drafting application to design small Technical Drawing sketches.
This application is inspired by the 'Classical Construction',
also known as 'Ruler-and-compass Construction' or 'Compass-and-straightedge construction'.
However, another drawing tools can be used.
(More info about classical construction: Wikipedia)
width=Width
height=Height
degrees=deg
@@ -147,6 +147,8 @@ view=View
appearance=Appearance
help=Help
+item_style=Show/hide style bar
+item_ruler_prot=Show/hide ruler&protractor bar
item_status=Show/hide status bar
item_action=Show/hide action bar
item_shape=Show/hide shape bar
diff --git a/src/jdrafting/resources/language/language_es.properties b/src/jdrafting/resources/language/language_es.properties
index fb3215c..89d8e05 100644
--- a/src/jdrafting/resources/language/language_es.properties
+++ b/src/jdrafting/resources/language/language_es.properties
@@ -1,5 +1,5 @@
// general
-app_des=es una aplicación open source para diseñar pequeños ejercicios de Dibujo Técnico
+app_des=es una aplicación open-source para diseñar pequeños ejercicios de Dibujo Técnico.
Esta aplicación está inspirada por la 'Construcción clásica',
también conocida como 'Construcción de regla y compás'.
Sin embargo, otras herramientas de trazado pueden usarse.
(Más info sobre construcción clásica: Wikipedia)
width=Ancho
height=Alto
degrees=grad
@@ -147,6 +147,8 @@ view=Vista
appearance=Apariencia
help=Ayuda
+item_style=Mostrar/Ocultar barra de estilo
+item_ruler_prot=Mostrar/Ocultar barra de regla y compás
item_status=Mostrar/Ocultar barra de estado
item_action=Mostrar/Ocultar barra de acciones
item_shape=Mostrar/Ocultar barra de figuras