added transparency

This commit is contained in:
bancika
2011-01-09 00:08:13 +00:00
parent 300753bb85
commit d43e098216
15 changed files with 344 additions and 56 deletions
@@ -31,7 +31,6 @@ import org.diylc.plugins.statusbar.StatusBar;
import org.diylc.plugins.toolbox.ToolBox;
import org.diylc.presenter.Presenter;
public class MainFrame extends JFrame implements IView {
private static final long serialVersionUID = 1L;
@@ -64,7 +63,7 @@ public class MainFrame extends JFrame implements IView {
presenter.installPlugin(new ToolBox());
presenter.installPlugin(new FileManager());
presenter.installPlugin(new ClipboardManager());
// presenter.installPlugin(new OnlineManager());
// presenter.installPlugin(new OnlineManager());
presenter.installPlugin(new HelpManager());
presenter.installPlugin(new StatusBar());
@@ -97,7 +96,7 @@ public class MainFrame extends JFrame implements IView {
super.setVisible(b);
// TODO: hack to prevent painting issues in the scroll bar rulers. Find
// a better fix if possible.
Timer timer = new Timer(200, new ActionListener() {
Timer timer = new Timer(500, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -0,0 +1,26 @@
package org.diylc.gui.editor;
import javax.swing.JSlider;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.diylc.common.PropertyWrapper;
public class ByteEditor extends JSlider {
private static final long serialVersionUID = 1L;
public ByteEditor(final PropertyWrapper property) {
super();
setMinimum(0);
setMaximum(127);
setValue((Byte) property.getValue());
addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
property.setValue(new Integer(getValue()).byteValue());
}
});
}
}
@@ -25,6 +25,11 @@ public class FieldEditorFactory {
EnumEditor editor = new EnumEditor(property);
return editor;
}
if (Byte.class.isAssignableFrom(property.getType())
|| byte.class.isAssignableFrom(property.getType())) {
ByteEditor byteEditor = new ByteEditor(property);
return byteEditor;
}
return null;
}
}