diff --git a/lib/jme_3.3_lib.jar b/lib/jme_3.3_lib.jar
deleted file mode 100644
index 362b8a1..0000000
Binary files a/lib/jme_3.3_lib.jar and /dev/null differ
diff --git a/lib/jme_6_1.jar b/lib/jme_6_1.jar
new file mode 100644
index 0000000..27691f5
Binary files /dev/null and b/lib/jme_6_1.jar differ
diff --git a/src/jdrafting/geom/JDMath.java b/src/jdrafting/geom/JDMath.java
index edee2fa..f4bffe0 100644
--- a/src/jdrafting/geom/JDMath.java
+++ b/src/jdrafting/geom/JDMath.java
@@ -195,9 +195,9 @@ public static double projection( Point2D v, Point2D w )
/**
* Get incenter of a triangle
- * @param a vertex
- * @param b vertex
- * @param c vertex
+ * @param A vertex
+ * @param B vertex
+ * @param C vertex
* @return the incenter
*/
public static Point2D incenter( Point2D A, Point2D B, Point2D C )
diff --git a/src/jdrafting/geom/JDPoint.java b/src/jdrafting/geom/JDPoint.java
index d515a78..0acf074 100644
--- a/src/jdrafting/geom/JDPoint.java
+++ b/src/jdrafting/geom/JDPoint.java
@@ -18,7 +18,6 @@ public Point2D.Double toPoint2Ddouble()
@Override
public Rectangle2D getBounds2D()
{
- return new Rectangle2D.Double(
- getX1(), getY1(), Math.ulp( 0. ), Math.ulp( 0. ) );
+ return new Rectangle2D.Double( getX1(), getY1(), Math.ulp( 0. ), Math.ulp( 0. ) );
}
}
diff --git a/src/jdrafting/gui/Application.java b/src/jdrafting/gui/Application.java
index fe26389..50aa570 100644
--- a/src/jdrafting/gui/Application.java
+++ b/src/jdrafting/gui/Application.java
@@ -1,9 +1,9 @@
package jdrafting.gui;
import static jdrafting.gui.JDUtils.getLargeIcon;
+import static jdrafting.gui.JDUtils.getLocaleMnemonic;
import static jdrafting.gui.JDUtils.getLocaleText;
import static jdrafting.gui.JDUtils.getSmallIcon;
-import static jdrafting.gui.JDUtils.getLocaleMnemonic;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
@@ -30,6 +30,7 @@
import java.io.ObjectInputStream;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.Calendar;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
@@ -160,6 +161,7 @@
/**
* {@value #APPNAME} GUI class
* @author {@value #AUTHOR}, {@value #COPYLEFT}
+ * @since 0.1.0
* @version {@value #VERSION}
*/
@SuppressWarnings("serial")
@@ -170,13 +172,13 @@ public class Application extends JFrame
//////////////////////
// metainfo
public static final String APPNAME = "JDrafting";
- public static final String VERSION = "0.1.9";
+ public static final String VERSION = "0.1.10";
public static final String AUTHOR = "Miguel Alejandro Moreno Barrientos";
- public static final String COPYLEFT = "2016";
+ public static final String COPYLEFT = "2016,2020";
public static final String PROJECT_PAGE =
- "http://miguelalejandromorenobarrientos.github.io/jdrafting";
+ "http://miguelalejandromorenobarrientos.github.io/jdrafting";
public static final String GITHUB_REPOSITORY =
- "https://github.com/miguelalejandromorenobarrientos/jdrafting/tree/master";
+ "https://github.com/miguelalejandromorenobarrientos/jdrafting/tree/master";
// colors
public static Color toolMainColor = Color.BLUE;
// separators
@@ -188,9 +190,8 @@ public class Application extends JFrame
// STATIC VARS //
/////////////////
public static Locale locale = Locale.getDefault();
- public static String lookAndFeelClassName =
- UIManager.getSystemLookAndFeelClassName();
- public static boolean jmeEnabled = false;
+ public static String lookAndFeelClassName = UIManager.getSystemLookAndFeelClassName();
+ public static boolean jmeEnabled = true;
///////////////////
@@ -210,7 +211,7 @@ public class Application extends JFrame
private BasicStroke stroke = JDStrokes.PLAIN_ROUND.getStroke();
private Color pointColor = Color.DARK_GRAY;
private BasicStroke pointStroke =
- new BasicStroke( 8f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND );
+ new BasicStroke( 8f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND );
// undo/redo
public UndoManager undoManager;
public UndoableEditSupport undoSupport;
@@ -254,6 +255,11 @@ public class Application extends JFrame
/////////////////
public Application()
{
+ // easter egg joke
+ final int year = Calendar.getInstance().get( Calendar.YEAR );
+ if ( year >= 2030 )
+ System.out.println( "\n\tYeah! My program still running in " + year + "!!\n" );
+
// create app window
initUI();
createActions();
@@ -1168,7 +1174,7 @@ public void actionPerformed( ActionEvent e )
shapebar.add( actionMap.get( getLocaleText( "spline" ) ) );
shapebar.add( actionMap.get( getLocaleText( "free_hand" ) ) );
if ( jmeEnabled )
- shapebar.add( actionMap.get( "Math function" ) );
+ shapebar.add( actionMap.get( getLocaleText( "func" ) ) );
// toolbar
toolbar.add( actionMap.get( getLocaleText( "perp" ) ) );
toolbar.add( actionMap.get( getLocaleText( "para" ) ) );
@@ -1539,8 +1545,7 @@ public class EditAddShapeToExercise extends AbstractUndoableEdit
private JDraftingShape jdshape;
private int index;
- public EditAddShapeToExercise(@NotNull JDraftingShape jdshape,
- int index )
+ public EditAddShapeToExercise( @NotNull JDraftingShape jdshape, int index )
{
this.jdshape = jdshape;
this.index = index;
@@ -1633,8 +1638,7 @@ public static void main( String[] args )
// (some parameters like lang, lookfeel need to be executed
// before app intantiation)
JDraftingArgs argsParser = new JDraftingArgs( null );
- ParsedParameterMap parsedMap =
- argsParser.parseAndExecute( args );
+ ParsedParameterMap parsedMap = argsParser.parseAndExecute( args );
// application instance
Application app = new Application();
@@ -1649,8 +1653,7 @@ public static void main( String[] args )
// load file from console
// (file load must be executed with a visible app)
if ( parsedMap.containsParam( "file" ) )
- app.openFile(
- new File( parsedMap.getValues( "file" )[0] ) );
+ app.openFile( new File( parsedMap.getValues( "file" )[0] ) );
}
catch ( NoSuchElementException e )
{
diff --git a/src/jdrafting/gui/CanvasPanel.java b/src/jdrafting/gui/CanvasPanel.java
index 718b923..550b69e 100644
--- a/src/jdrafting/gui/CanvasPanel.java
+++ b/src/jdrafting/gui/CanvasPanel.java
@@ -170,6 +170,9 @@ public void paintComponent( Graphics g )
Graphics2D g2 = (Graphics2D) g;
+ // High quality render
+ JDUtils.setHighQualityRender( g2 );
+
// draw exercise shapes
drawExercise( g2, getTransform(), app.getExercise(),
app.getSelectedShapes(), app.isVisibleNames() );
@@ -599,7 +602,8 @@ class MoveCanvasThread extends Thread
public void stopMe() { stop = true; }
@Override
- public void run() {
+ public void run()
+ {
while ( !stop )
{
try { Thread.sleep( wait < MAX_WAIT ? 20 : 200 ); }
diff --git a/src/jdrafting/gui/JDUtils.java b/src/jdrafting/gui/JDUtils.java
index 0d9e289..7162b04 100644
--- a/src/jdrafting/gui/JDUtils.java
+++ b/src/jdrafting/gui/JDUtils.java
@@ -2,8 +2,10 @@
import java.awt.Cursor;
import java.awt.Dimension;
+import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
+import java.awt.RenderingHints;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.util.Locale;
@@ -26,7 +28,7 @@ public class JDUtils
private JDUtils() {}
public static int smallIconSize = 16;
- public static int largeIconSize = 32;
+ public static int largeIconSize = 24;
/**
* Get screen size, multiplied by factor
@@ -146,4 +148,22 @@ public static String camelCase( String text )
return String.join( "", words );
}
+
+ public static void setHighQualityRender( Graphics2D g2 )
+ {
+ g2.setRenderingHint( RenderingHints.KEY_TEXT_ANTIALIASING,
+ RenderingHints.VALUE_TEXT_ANTIALIAS_ON );
+ g2.setRenderingHint( RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON );
+ g2.setRenderingHint( RenderingHints.KEY_RENDERING,
+ RenderingHints.VALUE_RENDER_QUALITY );
+ g2.setRenderingHint( RenderingHints.KEY_ALPHA_INTERPOLATION,
+ RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY );
+ g2.setRenderingHint( RenderingHints.KEY_COLOR_RENDERING,
+ RenderingHints.VALUE_COLOR_RENDER_QUALITY );
+ g2.setRenderingHint( RenderingHints.KEY_DITHERING,
+ RenderingHints.VALUE_DITHER_ENABLE );
+ g2.setRenderingHint( RenderingHints.KEY_INTERPOLATION,
+ RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+ }
}
diff --git a/src/jdrafting/gui/ShapeList.java b/src/jdrafting/gui/ShapeList.java
index c51a7ab..2e9aa66 100644
--- a/src/jdrafting/gui/ShapeList.java
+++ b/src/jdrafting/gui/ShapeList.java
@@ -113,8 +113,7 @@ public void valueChanged( ListSelectionEvent e )
/**
* ListCellRenderer
*/
- class ShapeListRenderer extends JPanel implements
- ListCellRenderer
"
- + "
@" + Application.COPYLEFT
+ + "Math parser for functions: "
+ + ""
+ + "JME parser"
+ + "
"
+ + "
(C)" + Application.COPYLEFT
+ "