Skip to content

Commit

Permalink
fixed full-image changes, layers, other stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
HeroesGrave committed Oct 24, 2014
1 parent 20270e4 commit 1c7add6
Show file tree
Hide file tree
Showing 63 changed files with 915 additions and 847 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -14,6 +14,7 @@
# Other #
/etc
/doc
/test
*.sh
*.directory
.license
Binary file removed build/Paint.JAVA.jar
Binary file not shown.
1 change: 0 additions & 1 deletion build/version

This file was deleted.

3 changes: 1 addition & 2 deletions src/heroesgrave/paint/gui/AboutDialog.java
Expand Up @@ -36,10 +36,9 @@
import com.alee.laf.rootpane.WebFrame;
import com.alee.laf.text.WebTextPane;

@SuppressWarnings("serial")
public class AboutDialog extends WebDialog
{
private static final long serialVersionUID = -1020702247965837857L;

public AboutDialog(WebFrame frame)
{
super(frame, "About Paint.JAVA");
Expand Down
149 changes: 0 additions & 149 deletions src/heroesgrave/paint/gui/BackgroundPanel.java

This file was deleted.

15 changes: 7 additions & 8 deletions src/heroesgrave/paint/gui/ColourChooser.java
Expand Up @@ -20,7 +20,6 @@

package heroesgrave.paint.gui;

import heroesgrave.paint.gui.Menu.CentredJDialog;
import heroesgrave.paint.main.Paint;
import heroesgrave.utils.io.IOUtils;
import heroesgrave.utils.io.TxtFileFilter;
Expand Down Expand Up @@ -55,9 +54,7 @@
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
Expand All @@ -66,6 +63,9 @@
import javax.swing.WindowConstants;
import javax.swing.border.TitledBorder;

import com.alee.laf.rootpane.WebDialog;
import com.alee.laf.rootpane.WebFrame;

public class ColourChooser
{

Expand Down Expand Up @@ -1096,7 +1096,7 @@ public void mouseExited(MouseEvent e)
/** **/
/** **/

JDialog dialog;
WebDialog dialog;
SpringLayout dialogLayout;

JPanel chooserLeft;
Expand Down Expand Up @@ -1173,11 +1173,11 @@ public void mouseExited(MouseEvent e)
}

@SuppressWarnings("serial")
public ColourChooser(JFrame mainFrame)
public ColourChooser(WebFrame mainFrame)
{

// ----- Create the Dialog
dialog = new CentredJDialog(mainFrame, "Colour-Chooser - Editing PRIMARY Color");
dialog = new WebDialog(mainFrame, "Colour-Chooser - Editing PRIMARY Color");
dialogLayout = new SpringLayout();

// ----- Do the typical configurations for it.
Expand Down Expand Up @@ -1633,7 +1633,6 @@ public void show()
// We do this because we don't wan't to spend an awful lot of time on the Swing-side of Java internally changing states.
if(!dialog.isVisible())
dialog.setVisible(true);

}

/**
Expand Down Expand Up @@ -1803,7 +1802,7 @@ public void setSelectedEditColour(int c, boolean invert)
*
* @return The colour-choosers JDialog instance.
**/
public JDialog getDialog()
public WebDialog getDialog()
{
return dialog;
}
Expand Down
28 changes: 28 additions & 0 deletions src/heroesgrave/paint/gui/Effects.java
@@ -0,0 +1,28 @@
package heroesgrave.paint.gui;

import heroesgrave.paint.gui.ToolMenu.EffectMenuItem;
import heroesgrave.paint.tools.effects.Effect;
import heroesgrave.paint.tools.effects.Invert;

import com.alee.laf.menu.WebMenu;

public class Effects
{
public WebMenu effects, operations;

public void addEffect(Effect effect, String shortcut)
{
effects.add(new EffectMenuItem(effect.name, effect, shortcut));
}

public void addOperation(Effect effect, String shortcut)
{
operations.add(new EffectMenuItem(effect.name, effect, shortcut));
}

public void registerEffects()
{
addEffect(new Invert("Invert Colour"), "I");
//PluginManager.instance.registerEffects(this);
}
}
71 changes: 7 additions & 64 deletions src/heroesgrave/paint/gui/GUIManager.java
Expand Up @@ -40,7 +40,6 @@
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
Expand Down Expand Up @@ -134,13 +133,12 @@ public void init()
{
initFrame();
initMenu();
//initBGPanel();
this.canvasPanel = new PaintCanvas(frame);
panel.add(canvasPanel, BorderLayout.CENTER);

chooser = new ColourChooser(frame);
layers = new LayerManager();
layers = new LayerManager(frame);
about = new AboutDialog(frame);

Paint.main.tools.toolbox = toolBox = new ToolBox();
panel.add(toolBox.getToolbar(), BorderLayout.WEST);
finish();
Expand All @@ -165,59 +163,6 @@ public void setTitle(String title)
frame.setTitle(title);
}

/*
public void setRenderer(Renderer r)
{
this.canvasPanel.setRenderer(r);
}
public void initBGPanel()
{
this.canvasPanel = new BackgroundPanel();
scroll = new WebScrollPane(canvasPanel);
scroll.removeMouseWheelListener(scroll.getMouseWheelListeners()[0]);
scroll.addMouseWheelListener(new MouseWheelListener()
{
@Override
public void mouseWheelMoved(final MouseWheelEvent e)
{
if(e.isControlDown())
{
if(e.getUnitsToScroll() > 0)
{
canvasPanel.decZoom();
}
else if(e.getUnitsToScroll() < 0)
{
canvasPanel.incZoom();
}
}
else
{
if(e.isShiftDown())
{
// Horizontal scrolling
Adjustable adj = scroll.getHorizontalScrollBar();
int scroll = e.getUnitsToScroll() * adj.getBlockIncrement();
adj.setValue(adj.getValue() + scroll);
}
else
{
// Vertical scrolling
Adjustable adj = scroll.getVerticalScrollBar();
int scroll = e.getUnitsToScroll() * adj.getBlockIncrement();
adj.setValue(adj.getValue() + scroll);
}
}
}
});
scroll.getVerticalScrollBar().setUnitIncrement(16);
scroll.getHorizontalScrollBar().setUnitIncrement(16);
this.panel.add(scroll, BorderLayout.CENTER);
}
*/

public void initMenu()
{
info = new InfoMenuBar();
Expand Down Expand Up @@ -298,7 +243,7 @@ public void displayCloseDialogue()
}

// dialogue creation
final JDialog close = new WebDialog(frame, "Save before you quit?");
final WebDialog close = new WebDialog(frame, "Save before you quit?");
close.setAlwaysOnTop(true);
close.setAutoRequestFocus(true);
close.setLayout(new BorderLayout());
Expand Down Expand Up @@ -347,7 +292,7 @@ public void actionPerformed(ActionEvent e)
close.pack();
close.setResizable(false);
close.setVisible(true);
close.setLocationRelativeTo(null);
close.setLocationRelativeTo(frame);
}

/**
Expand All @@ -364,11 +309,7 @@ public void finish()

public void initInputs()
{
Input in = new Input();

frame.addKeyListener(in);
chooser.getDialog().addKeyListener(in);
layers.getDialog().addKeyListener(in);
frame.addKeyListener(new Input());
}

public static final ImageIcon getIcon(String name)
Expand Down Expand Up @@ -405,5 +346,7 @@ public void repaint()
public void setDocument(Document document)
{
canvasPanel.setDocument(document);
layers.setDocument(document);
document.reconstructFlatmap();
}
}

0 comments on commit 1c7add6

Please sign in to comment.