-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad417fe
commit d04fcde
Showing
22 changed files
with
619 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/jdrafting/gui/controller/actions/ActionTrianglePoints.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package jdrafting.gui.controller.actions; | ||
|
||
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; | ||
import java.awt.event.KeyEvent; | ||
|
||
import javax.swing.AbstractAction; | ||
import javax.swing.KeyStroke; | ||
|
||
import jdrafting.gui.Application; | ||
import jdrafting.gui.controller.mouse.AngleListener; | ||
|
||
@SuppressWarnings("serial") | ||
public class ActionTrianglePoints extends AbstractAction | ||
{ | ||
private Application app; | ||
|
||
public ActionTrianglePoints( Application app ) | ||
{ | ||
this.app = app; | ||
|
||
putValue( NAME, getLocaleText( "angle" ) ); | ||
putValue( SHORT_DESCRIPTION, getLocaleText( "angle_des" ) ); | ||
putValue( MNEMONIC_KEY, KeyEvent.VK_N ); | ||
putValue( ACCELERATOR_KEY, | ||
KeyStroke.getKeyStroke( KeyEvent.VK_6, InputEvent.CTRL_MASK ) ); | ||
putValue( SMALL_ICON, getSmallIcon( "angle.png" ) ); | ||
putValue( LARGE_ICON_KEY, getLargeIcon( "angle.png" ) ); | ||
} | ||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) | ||
{ | ||
app.getCanvas().setCanvasListener( | ||
new AngleListener( app.getCanvas() ) ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package jdrafting.gui.controller.actions; | ||
|
||
import static jdrafting.gui.JDUtils.getLargeIcon; | ||
import static jdrafting.gui.JDUtils.getLocaleText; | ||
|
||
import java.awt.event.ActionEvent; | ||
import java.awt.event.KeyEvent; | ||
|
||
import javax.swing.AbstractAction; | ||
|
||
import jdrafting.gui.Application; | ||
import jdrafting.gui.controller.mouse.TriangleListener; | ||
|
||
@SuppressWarnings("serial") | ||
public class TriangleAction extends AbstractAction | ||
{ | ||
private Application app; | ||
|
||
public TriangleAction( Application app ) | ||
{ | ||
this.app = app; | ||
|
||
putValue( NAME, getLocaleText( "triangle" ) ); | ||
putValue( SHORT_DESCRIPTION, getLocaleText( "triangle_des" ) ); | ||
putValue( MNEMONIC_KEY, KeyEvent.VK_T ); | ||
/*putValue( ACCELERATOR_KEY, | ||
KeyStroke.getKeyStroke( KeyEvent.VK_5, InputEvent.CTRL_MASK ) );*/ | ||
putValue( SMALL_ICON, getLargeIcon( "triangle.png" ) ); | ||
putValue( LARGE_ICON_KEY, getLargeIcon( "triangle.png" ) ); | ||
} | ||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) | ||
{ | ||
app.getCanvas().setCanvasListener( | ||
new TriangleListener( app.getCanvas() ) ); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/jdrafting/gui/controller/actions/TrianglePointsAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package jdrafting.gui.controller.actions; | ||
|
||
import static jdrafting.gui.JDUtils.getLargeIcon; | ||
|
||
import java.awt.event.ActionEvent; | ||
|
||
import javax.swing.AbstractAction; | ||
import javax.swing.ImageIcon; | ||
|
||
import jdrafting.gui.Application; | ||
import jdrafting.gui.controller.mouse.TrianglePointsListener; | ||
|
||
@SuppressWarnings("serial") | ||
public class TrianglePointsAction extends AbstractAction | ||
{ | ||
private Application app; | ||
private int type; | ||
|
||
public TrianglePointsAction( Application app, int type ) | ||
{ | ||
this.app = app; | ||
this.type = type; | ||
|
||
putValue( NAME, TrianglePointsListener.getName( type ) ); | ||
ImageIcon large = null; | ||
switch( type ) | ||
{ | ||
case TrianglePointsListener.INCENTER: | ||
large = getLargeIcon( "incenter.png" ); | ||
break; | ||
case TrianglePointsListener.BARICENTER: | ||
large = getLargeIcon( "baricenter.png" ); | ||
break; | ||
case TrianglePointsListener.CIRCUMCENTER: | ||
large = getLargeIcon( "circumcenter.png" ); | ||
break; | ||
case TrianglePointsListener.ORTOCENTER: | ||
large = getLargeIcon( "ortocenter.png" ); | ||
break; | ||
} | ||
putValue( SMALL_ICON, large ); | ||
putValue( LARGE_ICON_KEY, large ); | ||
} | ||
|
||
@Override | ||
public void actionPerformed( ActionEvent e ) | ||
{ | ||
app.getCanvas().setCanvasListener( | ||
new TrianglePointsListener( app.getCanvas(), type ) ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,7 +135,7 @@ else if ( bis1 == null ) | |
} | ||
canvas.repaint(); | ||
} | ||
|
||
@Override | ||
public void paintTool( Graphics2D g2 ) | ||
{ | ||
|
Oops, something went wrong.