|
|
|
|
Page 1 of 1
|
[ 6 posts ] |
|
Custom java.util.Calendar support
| Author |
Message |
|
pwpatton
Joined: Wed Feb 29, 2012 4:17 am Posts: 3
|
 Custom java.util.Calendar support
Can mig calendar support subclasses of the Calendar object? We are looking into implementing a ComputedIslamicCalendar subclass of java.util.Calendar. We are interested in purchasing MigCalendar but require calendars other than Gregorian. Is this possible with MigCalendar?
|
| Wed Feb 29, 2012 4:27 am |
|
 |
|
MiG Support
Site Admin
Joined: Mon Dec 06, 2004 4:24 pm Posts: 2485 Location: Sweden
|
 Re: Custom java.util.Calendar support
Hello,
That's impossible to say unfortunately. It depends on which customizations you make to it. You'll have to test it.
Thanks,
|
| Wed Feb 29, 2012 11:07 am |
|
 |
|
pwpatton
Joined: Wed Feb 29, 2012 4:17 am Posts: 3
|
 Re: Custom java.util.Calendar support
I am looking on http://migcalendar.com/docs/javadoc/index.html and cannot find any way of setting a java.util.Calendar in the API. Can you direct me to the method that allow the setting of a java.util.Calendar that the MigCalendar will use?
|
| Wed Feb 29, 2012 5:12 pm |
|
 |
|
MiG Support
Site Admin
Joined: Mon Dec 06, 2004 4:24 pm Posts: 2485 Location: Sweden
|
 Re: Custom java.util.Calendar support
It is using Calendar.getInstance(..) everywhere so no connection to a specific calendar type.
Thanks,
|
| Wed Feb 29, 2012 7:57 pm |
|
 |
|
pwpatton
Joined: Wed Feb 29, 2012 4:17 am Posts: 3
|
 Re: Custom java.util.Calendar support
Ok, so what are my options:
1. You folks update MigCalendar to take a java.util.Calendar as input. As long as our custom class extends the java.util.Calendar base type I don't see this as a big issue.
2. Buy the source code and modify it ourselves to take a java.util.Calendar as input.
We'd like to buy your control but we cannot unless it supports Calendar types not returned by Calendar.getInstance(). Java (including 1.7) currently only has 3 sub classes of Calendar: java.util.Gregorian, sun.util.BuddhistCalendar, and java.util.JapaneseImperialCalendar.
Gregorian and Buddhist both seem to work with MigCalendar. Just set your locale on the command line for Buddhist.
java -Duser.language=th -Duser.region=TH AppFrame
JapaneseImperialCalendar gets an exception with the AppFrame example.
java -Duser.language=ja -Duser.country=JP -Duser.variant=JP AppFrame
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 13 at sun.util.calendar.BaseCalendar.getDayOfYear(BaseCalendar.java:329) at sun.util.calendar.BaseCalendar.getFixedDate(BaseCalendar.java:364) at sun.util.calendar.BaseCalendar.getFixedDate(BaseCalendar.java:339) at sun.util.calendar.AbstractCalendar.getTime(AbstractCalendar.java:157) at sun.util.calendar.BaseCalendar.normalize(BaseCalendar.java:211) at sun.util.calendar.LocalGregorianCalendar.normalize(LocalGregorianCalendar.java:259) at java.util.JapaneseImperialCalendar.pinDayOfMonth(JapaneseImperialCalendar.java:2293) at java.util.JapaneseImperialCalendar.add(JapaneseImperialCalendar.java:364) at com.miginfocom.util.dates.DateRange.addEnd(SourceFile) at com.miginfocom.util.dates.DateRange.setSize(SourceFile) at com.miginfocom.util.dates.DateRange$a.<init>(SourceFile) at com.miginfocom.util.dates.DateRange.iterator(SourceFile) at com.miginfocom.calendar.decorators.DateSeparatorDecorator.doPaint(SourceFile) at com.miginfocom.calendar.decorators.DecoratorSupport.paintDecorations(SourceFile) at com.miginfocom.calendar.datearea.DefaultDateArea.paintComponent(SourceFile) at javax.swing.JComponent.paint(JComponent.java:1029) at javax.swing.JComponent.paintToOffscreen(JComponent.java:5124) at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1479) at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1410) at javax.swing.RepaintManager.paint(RepaintManager.java:1224) at javax.swing.JComponent._paintImmediately(JComponent.java:5072) at javax.swing.JComponent.paintImmediately(JComponent.java:4882) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:785) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713) at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693) at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
|
| Wed Feb 29, 2012 11:44 pm |
|
 |
|
MiG Support
Site Admin
Joined: Mon Dec 06, 2004 4:24 pm Posts: 2485 Location: Sweden
|
 Re: Custom java.util.Calendar support
Can you post the latest post as a support ticket?
From there it's easier to track the progress.
http://miginfocom.helpserve.com/index.php
Thanks,
|
| Wed Feb 29, 2012 11:47 pm |
|
|
|
Page 1 of 1
|
[ 6 posts ] |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|