Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements #9

Merged
merged 19 commits into from Dec 10, 2014
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Translate tool panel.

  • Loading branch information...
RobertBColton committed Dec 9, 2014
commit 222297e24b09b5d2c18e183e8074e3891ef581d7
@@ -7,6 +7,7 @@
* Copyright (C) 2009, 2012 IsmAvatar <IsmAvatar@gmail.com>
* Copyright (C) 2009 Serge Humphrey <bob@bobtheblueberry.com>
* Copyright (C) 2013 jimn346 <jds9496@gmail.com>
* Copyright (C) 2014 Robert B. Colton
*
* This file is a part of JEIE.
*
@@ -5,6 +5,7 @@
* @section License
*
* Copyright (C) 2012 IsmAvatar <IsmAvatar@gmail.com>
* Copyright (C) 2014 Robert B. Colton
*
* This file is a part of JEIE.
*
@@ -58,6 +59,15 @@
protected JPanel toolOptions = new JPanel();

AbstractButton defTool;

public ToolButton makeToolButton(String key, Tool t) {
ToolButton tb = new ToolButton(Resources.getString("ToolPanel." + key), t);
tb.setActionCommand(key);
tb.addActionListener(this);
//tb.setAccelerator(KeyStroke.getKeyStroke(Resources.getKeyboardString("TransformMenu." + key)));
tb.setIcon(Resources.getIconForKey("ToolPanel." + key));
return tb;
}

public ToolPanel(ToolDelegate del)
{
@@ -68,22 +78,14 @@ public ToolPanel(ToolDelegate del)

toolGrid = new JPanel(new GridLayout(0,2));

addButton(new ToolButton(Resources.getIcon("pencil"),"Pencil - draws freehand strokes",
new PointTool()));
defTool = addButton(new ToolButton(Resources.getIcon("line"),"Line - draws a straight line",
new LineTool()));
addButton(new ToolButton(Resources.getIcon("rect"),"Rect - draws a rectangle",
new RectangleTool()));
addButton(new ToolButton(Resources.getIcon("oval"),"Oval - draws an oval",
new OvalTool()));
addButton(new ToolButton(Resources.getIcon("color-fill"),"Fill - flood-fills a region",
new FillTool()));
addButton(new ToolButton(Resources.getIcon("color-picker"),"Color Picker - get the color at a point",
new ColorPickerTool()));
addButton(new ToolButton(Resources.getIcon("text"),"Text - Draw text",
new TextTool()));
addButton(new ToolButton(Resources.getIcon("gradient-linear"),"Gradient - draw gradients",
new GradientTool()));
addButton(makeToolButton("PENCIL",new PointTool()));
defTool = addButton(makeToolButton("LINE",new LineTool()));
addButton(makeToolButton("RECT",new RectangleTool()));
addButton(makeToolButton("OVAL",new OvalTool()));
addButton(makeToolButton("COLOR_FILL",new FillTool()));
addButton(makeToolButton("COLOR_PICKER",new ColorPickerTool()));
addButton(makeToolButton("TEXT",new TextTool()));
addButton(makeToolButton("GRADIENT_LINEAR",new GradientTool()));

toolOptions.setBorder(BorderFactory.createLoweredBevelBorder());
toolOptions.setMaximumSize(toolGrid.getPreferredSize());
@@ -112,7 +114,17 @@ public void selectDefault()
private static final long serialVersionUID = 1L;

public final Tool tool;

public ToolButton(String tip, Tool t)
{
this(null,tip,t);
}

public ToolButton(Tool t)
{
this(null,null,t);
}

public ToolButton(ImageIcon ico, Tool t)
{
this(ico,null,t);
@@ -5,6 +5,7 @@
* @section License
*
* Copyright (C) 2013 jimn346 <jds9496@gmail.com>
* Copyright (C) 2014 Robert B. Colton
*
* This file is a part of JEIE.
*
@@ -31,3 +31,13 @@ EffectsMenu.VALUE=value
EffectsMenu.INVERT=invert
EffectsMenu.FADE=fade
EffectsMenu.COLORIZE=colorize

# Tool Panel
ToolPanel.PENCIL=pencil
ToolPanel.LINE=line
ToolPanel.RECT=rect
ToolPanel.OVAL=oval
ToolPanel.COLOR_FILL=color-fill
ToolPanel.COLOR_PICKER=color-picker
ToolPanel.TEXT=text
ToolPanel.GRADIENT_LINEAR=gradient-linear
@@ -42,3 +42,13 @@ EffectsMenu.VALUE=Value
EffectsMenu.INVERT=Invert
EffectsMenu.FADE=Fade to Black
EffectsMenu.COLORIZE=Colorize

# Tool Panel
ToolPanel.PENCIL=Pencil - draws freehand strokes
ToolPanel.LINE=Line - draws a straight line
ToolPanel.RECT=Rect - draws a rectangle
ToolPanel.OVAL=Oval - draws an oval
ToolPanel.COLOR_FILL=Fill - flood-fills a region
ToolPanel.COLOR_PICKER=Color Picker - get the color at a point
ToolPanel.TEXT=Text - Draw text
ToolPanel.GRADIENT_LINEAR=Gradient - draw gradients
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.