Permalink
Browse files

Moving from microba.sf.net

  • Loading branch information...
tdbear committed Mar 17, 2014
1 parent 78b6d65 commit b8e4ab8728db135c2e52afc6ac71250ae938d59f
Showing with 8,819 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +77 −0 change.log.txt
  3. +69 −0 pom.xml
  4. +41 −0 readme.txt
  5. +180 −0 src/main/java/com/michaelbaranov/microba/Microba.java
  6. +46 −0 src/main/java/com/michaelbaranov/microba/calendar/CalendarColors.java
  7. +774 −0 src/main/java/com/michaelbaranov/microba/calendar/CalendarPane.java
  8. +35 −0 src/main/java/com/michaelbaranov/microba/calendar/CalendarResources.java
  9. +391 −0 src/main/java/com/michaelbaranov/microba/calendar/DatePicker.java
  10. +83 −0 src/main/java/com/michaelbaranov/microba/calendar/DatePickerCellEditor.java
  11. +43 −0 src/main/java/com/michaelbaranov/microba/calendar/DefaultCalendarResources.java
  12. +28 −0 src/main/java/com/michaelbaranov/microba/calendar/DefaultCalendarResources.properties
  13. +55 −0 src/main/java/com/michaelbaranov/microba/calendar/HolidayPolicy.java
  14. +40 −0 src/main/java/com/michaelbaranov/microba/calendar/VetoPolicy.java
  15. +5 −0 src/main/java/com/michaelbaranov/microba/calendar/resource/Resource.java
  16. BIN src/main/java/com/michaelbaranov/microba/calendar/resource/back-16.png
  17. BIN src/main/java/com/michaelbaranov/microba/calendar/resource/back-fast-16.png
  18. BIN src/main/java/com/michaelbaranov/microba/calendar/resource/forward-16.png
  19. BIN src/main/java/com/michaelbaranov/microba/calendar/resource/forward-fast-16.png
  20. BIN src/main/java/com/michaelbaranov/microba/calendar/resource/picker-16.png
  21. +14 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/CalendarPaneUI.java
  22. +9 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/DatePickerUI.java
  23. +236 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/AuxPanel.java
  24. +429 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/BasicCalendarPaneUI.java
  25. +403 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/BasicDatePickerUI.java
  26. +718 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/CalendarGridPanel.java
  27. +153 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/CalendarHeader.java
  28. +130 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/CalendarNumberOfWeekPanel.java
  29. +265 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/ClassicCalendarPanel.java
  30. +166 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/ModernCalendarPanel.java
  31. +135 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/MonthComboBoxModel.java
  32. +57 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/MonthComboBoxRenderer.java
  33. +41 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/NoGroupingSpinner.java
  34. +158 −0 src/main/java/com/michaelbaranov/microba/calendar/ui/basic/YearSpinnerModel.java
  35. +64 −0 src/main/java/com/michaelbaranov/microba/common/AbstractBoundedTableModel.java
  36. +128 −0 src/main/java/com/michaelbaranov/microba/common/AbstractBoundedTableModelWithSelection.java
  37. +36 −0 src/main/java/com/michaelbaranov/microba/common/AbstractPolicy.java
  38. +57 −0 src/main/java/com/michaelbaranov/microba/common/BoundedTableModel.java
  39. +40 −0 src/main/java/com/michaelbaranov/microba/common/CommitEvent.java
  40. +19 −0 src/main/java/com/michaelbaranov/microba/common/CommitListener.java
  41. +85 −0 src/main/java/com/michaelbaranov/microba/common/MicrobaComponent.java
  42. +19 −0 src/main/java/com/michaelbaranov/microba/common/Policy.java
  43. +23 −0 src/main/java/com/michaelbaranov/microba/common/PolicyEvent.java
  44. +19 −0 src/main/java/com/michaelbaranov/microba/common/PolicyListener.java
  45. +289 −0 src/main/java/com/michaelbaranov/microba/demo/Demo.java
  46. +110 −0 src/main/java/com/michaelbaranov/microba/gradient/DefaultGradientModel.java
  47. +310 −0 src/main/java/com/michaelbaranov/microba/gradient/GradientBar.java
  48. +56 −0 src/main/java/com/michaelbaranov/microba/gradient/ui/GradientListener.java
  49. +129 −0 src/main/java/com/michaelbaranov/microba/gradient/ui/GradientUI.java
  50. +182 −0 src/main/java/com/michaelbaranov/microba/gradient/ui/basic/BasicGradientUI.java
  51. +127 −0 src/main/java/com/michaelbaranov/microba/gradienteditor/DefaultGradientEditorModel.java
  52. +177 −0 src/main/java/com/michaelbaranov/microba/gradienteditor/GradientEditor.java
  53. +60 −0 src/main/java/com/michaelbaranov/microba/gradienteditor/ui/GradientEditorLayout.java
  54. +27 −0 src/main/java/com/michaelbaranov/microba/gradienteditor/ui/GradientEditorListener.java
  55. +7 −0 src/main/java/com/michaelbaranov/microba/gradienteditor/ui/GradientEditorUI.java
  56. +172 −0 src/main/java/com/michaelbaranov/microba/gradienteditor/ui/basic/BasicGradientEditorUI.java
  57. +388 −0 src/main/java/com/michaelbaranov/microba/jgrpah/birdview/Birdview.java
  58. +227 −0 src/main/java/com/michaelbaranov/microba/marker/DefaultMarkerModel.java
  59. +378 −0 src/main/java/com/michaelbaranov/microba/marker/MarkerBar.java
  60. +35 −0 src/main/java/com/michaelbaranov/microba/marker/MarkerMutationModel.java
  61. +307 −0 src/main/java/com/michaelbaranov/microba/marker/ui/MarkerBarListener.java
  62. +195 −0 src/main/java/com/michaelbaranov/microba/marker/ui/MarkerBarUI.java
  63. +275 −0 src/main/java/com/michaelbaranov/microba/marker/ui/basic/BasicMarkerBarUI.java
  64. +23 −0 src/main/java/com/michaelbaranov/microba/marker/ui/metal/MetalMarkerBarUI.java
  65. +21 −0 src/main/java/com/michaelbaranov/microba/marker/ui/motif/MotifMarkerBarUI.java
  66. +51 −0 src/main/java/com/michaelbaranov/microba/marker/ui/windows/WindowsMarkerBarUI.java
View
@@ -0,0 +1,2 @@
/target
/.project
View
@@ -0,0 +1,77 @@
v.0.4.4.1
* Change: changed project directory structure according to Maven guidelines.
* Fixed: DatePicker popup did not close when clicked on already selecteed date.
* CalendarPane.fireCommitEvent(boolean) made public
* CalendarPane.fireActionEvent() made public
v.0.4.4
* Added: DatePicker.dropdownFocusable property
* Added: MicrobaComponent.colorOverrideMap property
* Added: Microba.setColorOverrideMap method
These two improvements allow to override colors on per-instance and per-L&F basis.
Currenty CalendarPane and DatePicker support some color overriding.
* Fixed: CalendarPane ignores enabled property
v.0.4.3.4 (21 nov 2006)
* Fixed: Microba works with NetBeans Matisse GUI editor.
Thanks to Witold Szczerba for testing the fix.
* Fixed: manifest now specifies javabeans
* Refactored: common superclass extracted: MicrobaComponent
v.0.4.3.3
* Fixed: DatePicker ignores locale passed in constructor
v.0.4.3.2
* Fixed: DatePicker ignores showWeekNumber
* Fixed: DatePicker may return wrong date via getDate() in some cases
* Fixed: Portuguese translation corrected by Roger Araújo
v.0.4.3.1
* Fixed: DatePicker displays no tooltip string
* Fixed: DatePicker goes to infinite loop if keepTime is true, and date format has no time fields.
Thanks to Wolfgang Fietzke for his excellent bug report!
v0.4.3
* Added: Birdview component for JGraph library
* Added: Swedish translation for DatePicker
* Added: CalendarPane.stripDate ( and DatePicker.stripDate ) property (optional time stripping)
* Added: DatePicker.keepTime property (improved time field handling)
* Added: DatePicker.pickerStyle property (controls visual style of the picker itself)
* Added: DatePicker.showButtonOnly() shortcut method
* Added: static CalendarPane.stripDate(...) utility method
* Fixed: DatePicker.setDateFormat(...) never fired a PropertyChangeEvent
* Changed: picker-16.png ico for DatePicker changed
v.0.4.2 (31 jul 2006)
* Refactored: dateStyle property of DatePicker was dropped in favour of dateFormat property. However,
old constructors preserved.
* Fixed: OutOfMemory exception bug fixed. The bug prevented components to be garbage collected because
references were held by Timer tasks. Regression: CalendarPane will update 'today' date only
on creation.
v.0.4.1 (18 jun 2006)
* Added: ability to show number of weeks for DatePicker and CalendarPane.
* Fixed: Applet refresh problem: see readme.txt, see Microba.init()
* Fixed: Polish translation (thanks to Gregory Kaczmarczyk)
v.0.4 (29 mar 2006)
* Refactored: com.michaelbaranov.microba.common package introduced
* Refactored: class HollidayPolicy renamed to HolidayPolicy
* Refactored: properties named 'hollidayPolicy' renamed to 'holidayPolicy' in all classes
* Refactored: renamed recources in com.michaelbaranov.microba.calendar.resource:
16.png -> picker-16.png
l.png -> back-16.png
ll.png -> back-fast-16.png
r.png -> forward-16.png
rr.png -> forward-fast-16.png
* Added: MarkerBar, GradientBar, GradientEditor controls
* Added: multiple translations for CalendarPane UI
* Added: enabled/disabled state for DatePicker and CalendarPane
* Fixed: DatePickerCellEditor not respected focus lost behavior of the DatePicker.
Now it is possible to commit cell edit when cell edit stops (e.g. tab out).
v.0.3 (15 dec 2005)
* First public release
View
69 pom.xml
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.michaelbaranov.microba</groupId>
<artifactId>microba</artifactId>
<version>0.4.4</version>
<packaging>jar</packaging>
<name>Microba Controls</name>
<url>http://microba.sf.net</url>
<description>Microba Controls library</description>
<developers>
<developer>
<name>Michael Baranov</name>
<url>http://www.michaelbaranov.com</url>
</developer>
</developers>
<licenses>
<license>
<name>BSD</name>
<url>http://microba.sf.net/license.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<dependencies>
<dependency>
<groupId>jgraph</groupId>
<artifactId>jgraph</artifactId>
<version>5.8.3.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<include>**/*.png</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>
maven-project-info-reports-plugin
</artifactId>
<reportSets>
<reportSet>
<reports></reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</project>
View
@@ -0,0 +1,41 @@
TIPS & TRICKS:
1. In Applet#init(), call Microba.init() to handle browser refresh button correctly.
CONTRIBUTORS:
(random order)
* Alessandro Falappa: Italian translation
* Frido van Orden, Henk van Voorthuijsen: Dutch translation
* Gustavo Santucho: Spanish translation
* Gregory Kaczmarczyk: Polish translation
* Philipp Meier: German translation
* Claus Nielsen: Danish translation
* Felix Bordea: Romanian translation
* David Ekholm: Swedish translation
TRANSLATION:
For the list of supported language translations, look into
com\michaelbaranov\microba\calendar\DefaultCalendarResources.properties
Help translating needed! Please contribute!
Send the translations to: michael[.]baranov[@]gmail[.]com
KNOWN PROBLEMS:
1. DatePicker: while editing the field, enter arbitrary string after the last formatted character,
position cursor anywhere past the last formatted character, press up or down key -> exception is
raised:
java.lang.IllegalArgumentException: Invalid index
...
Reason: a bug in Sun's javax.swing.text.InternationalFormatter.
2. DatePicker: set the style to STYLE_MODERN, open dropdown, click month combo box -> dropdown
is hidden OR can not close dropdown anymore OR exception (depends on JRE version).
Reason: a bug in Sun's javax.swing.JPopupMenu, when using "popup in popup".
3. DatePicker: if a heavy-weight popup is used to display dropdown (for ex. it goes outside a JFrame),
dropdown does not receive keyboard focus anymore.
Reason: a bug in Sun's focus handling routines.
@@ -0,0 +1,180 @@
package com.michaelbaranov.microba;
import java.applet.Applet;
import java.awt.Color;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.HashMap;
import java.util.Map;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import com.michaelbaranov.microba.common.MicrobaComponent;
/**
* This class is used to initialize Microba library.
*
* @author Michael Baranov
*
*/
public class Microba {
private static UIChangeListener changeListener = new UIChangeListener();
/**
* Initializes the library: installs L&F properties, sets up a L&F change
* listener.
* <p>
* No need to call this method explicitly for desktop applications. You
* should only call it in {@link Applet#init()}. This will handle browser
* refresh button correctly.
*
*/
public static synchronized void init() {
setLookAndFeelProperties(UIManager.getLookAndFeel());
UIManager.removePropertyChangeListener(changeListener);
UIManager.addPropertyChangeListener(changeListener);
}
private static synchronized void setLookAndFeelProperties(
LookAndFeel lookAndFeel) {
if (lookAndFeel == null)
return;
String packagePrefix = "com.michaelbaranov.microba.";
// all L&F
UIManager.put("microba.CalendarPaneUI", packagePrefix
+ "calendar.ui.basic.BasicCalendarPaneUI");
UIManager.put("microba.DatePickerUI", packagePrefix
+ "calendar.ui.basic.BasicDatePickerUI");
UIManager.put("microba.GradientUI", packagePrefix
+ "gradient.ui.basic.BasicGradientUI");
UIManager.put("microba.GradientEditorUI", packagePrefix
+ "gradienteditor.ui.basic.BasicGradientEditorUI");
UIManager.put("microba.MarkerBarUI", packagePrefix
+ "marker.ui.basic.BasicMarkerBarUI");
// particular L&F
if (lookAndFeel.getID().equals("Windows")) {
UIManager.put("microba.MarkerBarUI", packagePrefix
+ "marker.ui.windows.WindowsMarkerBarUI");
} else if (lookAndFeel.getID().equals("Metal")) {
UIManager.put("microba.MarkerBarUI", packagePrefix
+ "marker.ui.metal.MetalMarkerBarUI");
} else if (lookAndFeel.getID().equals("Motif")) {
UIManager.put("microba.MarkerBarUI", packagePrefix
+ "marker.ui.motif.MotifMarkerBarUI");
}
}
private static final class UIChangeListener implements
PropertyChangeListener {
public void propertyChange(PropertyChangeEvent event) {
if ("lookAndFeel".equals(event.getPropertyName())) {
setLookAndFeelProperties((LookAndFeel) event.getNewValue());
}
}
}
private static Map lookAndFeelToOverride = new HashMap();
/**
* Sets per-Lokk&Feel map of color overrides.
*
*
* @param lookAndFeel
* look&feel ID
* @param overrides
* keys in the map are {@link String} constants, valuse are of
* type {@link Color} or of type {@link String} (in this case,
* {@link Color} values are obtained via
* {@link UIManager#getColor(Object)}). May be <code>null</code>.
*/
public static void setColorOverrideMap(String lookAndFeel, Map overrides) {
lookAndFeelToOverride.put(lookAndFeel, overrides);
// TODO: refresh ui delegates
}
/**
* Returns overriden color for given component in current Look&Feel. The
* algorithms is:
* <ul>
* <li>If the component overrides the constant (per-instance override),
* then it is returned.
* <li>If the library overrides the constant (per-Look&Feel override), then
* it is returned.
* <li>Else <code>null</code> is returned.
* </ul>
* This method is actually intended to be used by UI delegates of the
* library.
*
* @param colorConstant
* color constant
* @param component
* component of the library
* @return overriden color or <code>null</code> if not overriden
*/
public static synchronized Color getOverridenColor(String colorConstant,
MicrobaComponent component) {
Map componentOverrideMap = component.getColorOverrideMap();
if (componentOverrideMap != null) {
if (componentOverrideMap.containsKey(colorConstant)) {
Object val = componentOverrideMap.get(colorConstant);
if (val instanceof Color)
return (Color) val;
else
return UIManager.getColor(val);
}
}
String currentLookAndFeel = UIManager.getLookAndFeel().getID();
Map overrides = (Map) lookAndFeelToOverride.get(currentLookAndFeel);
if (overrides != null) {
if (overrides.containsKey(colorConstant)) {
Object val = overrides.get(colorConstant);
if (val instanceof Color)
return (Color) val;
else
return UIManager.getColor(val);
}
}
return null;
}
/**
* Returns overriden color for given component in current Look&Feel or a
* default value. The algorithms is:
* <ul>
* <li>If the component overrides the constant (per-instance override),
* then it is returned.
* <li>If the library overrides the constant (per-Look&Feel override), then
* it is returned.
* <li>Else defaultColor is returned.
* </ul>
* This method is actually intended to be used by UI delegates of the
* library.
*
* @param colorConstant
* color constant
* @param component
* component of the library
* @param defaultColor
* @return overriden color or defaultColor if not overriden
*/
public static synchronized Color getOverridenColor(String colorConstant,
MicrobaComponent component, Color defaultColor) {
Color overriden = getOverridenColor(colorConstant, component);
if (overriden != null)
return overriden;
else
return defaultColor;
}
}
Oops, something went wrong.

0 comments on commit b8e4ab8

Please sign in to comment.