|
Page 1 of 1
|
[ 12 posts ] |
|
Time turns/change scroller problem
| Author |
Message |
|
rocky20
Joined: Wed Jan 19, 2011 2:35 pm Posts: 11
|
 Time turns/change scroller problem
Hello MigSupport We have purchuased MigCalendar API and i'm now in phase of writing an application, which have current month view, but you can also scroll through entire year, i have also used your gridLine demo and aded scroll support. The problem is in march when hour change one hour forward and in some state of scroller you can see activities before hour move forward and after hour move forward, this is when problem occurs. hour 8 move upward and also activities move one hour up but this is not good. Her is the resetScroller codeCode: private void resetScroller() { TimeZone zone = TimeZone.getTimeZone("Europe/Ljubljana"); Calendar cal = Calendar.getInstance(); cal.set(Calendar.YEAR, PublicLightingOperationsDAO.DEFAULT_OPERATIONS_YEAR); cal.set(Calendar.DAY_OF_YEAR, scroller.getValue()); cal.setTimeZone(zone); long startMillis; // če imamo januar moramo prikazati še 31 december if (cal.get(Calendar.MONTH) == Calendar.JANUARY && cal.get(Calendar.DAY_OF_YEAR) == 1) { startMillis = new GregorianCalendar(cal.get(Calendar.YEAR) - 1, Calendar.DECEMBER, 31, LIGHTING_START_HOUR, 0, 0).getTimeInMillis(); } else { startMillis = new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), LIGHTING_START_HOUR, 0, 0).getTimeInMillis(); } Calendar calEnd = new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), LIGHTING_END_HOUR, 0, 0); calEnd.setTimeZone(zone); calEnd.add(Calendar.DAY_OF_MONTH, calEnd.getActualMaximum(Calendar.DAY_OF_MONTH)); long endMillis = calEnd.getTimeInMillis(); DateRange visibleRange = new DateRange(startMillis, endMillis, true, zone, null); dateAreaPane.getDateArea().setVisibleDateRange(visibleRange); } WestHeader codeCode: westHeader.setExpandToCorner(com.miginfocom.calendar.datearea.DateAreaContainer.CORNER_EXPAND_BOTH); westHeader.setHeaderRows(new com.miginfocom.calendar.header.CellDecorationRow[] { new com.miginfocom.calendar.header.CellDecorationRow( com.miginfocom.util.dates.DateRangeI.RANGE_TYPE_HOUR, new com.miginfocom.util.dates.DateFormatList("HH", null), new com.miginfocom.util.gfx.geometry.numbers.AtFixed(19.0f), new com.miginfocom.util.gfx.geometry.AbsRect(new com.miginfocom.util.gfx.geometry.numbers.AtStart(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtStart(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtEnd(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtEnd(0.0f), null, null, null), (java.awt.Paint[]) null, new java.awt.Paint[] {new java.awt.Color(102, 102, 102)}, new com.miginfocom.util.repetition.DefaultRepetition(0, 1, new com.miginfocom.util.gfx.geometry.numbers.AtStart(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtStart(32.0f)), new java.awt.Font[] {new java.awt.Font("Dialog", 0, 16)}, new java.lang.Integer[] {null}, new com.miginfocom.util.gfx.geometry.numbers.AtStart(1.0f), new com.miginfocom.util.gfx.geometry.numbers.AtStart(0.5f)), new com.miginfocom.calendar.header.CellDecorationRow( com.miginfocom.util.dates.DateRangeI.RANGE_TYPE_HOUR, new com.miginfocom.util.dates.DateFormatList("mm", null), new com.miginfocom.util.gfx.geometry.numbers.AtFixed(20.0f), new com.miginfocom.util.gfx.geometry.AbsRect(new com.miginfocom.util.gfx.geometry.numbers.AtStart(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtStart(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtEnd(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtEnd(0.0f), null, null, null), (java.awt.Paint[]) null, new java.awt.Paint[] {new java.awt.Color(102, 102, 102)}, new com.miginfocom.util.repetition.DefaultRepetition(0, 1, new com.miginfocom.util.gfx.geometry.numbers.AtStart(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtStart(32.0f)), new java.awt.Font[] {new java.awt.Font("Dialog", 0, 10)}, new java.lang.Integer[] {null}, new com.miginfocom.util.gfx.geometry.numbers.AtStart(2.0f), new com.miginfocom.util.gfx.geometry.numbers.AtStart(2.0f))});
gridDimensionLayout.setCompressRowsFormat(1); gridDimensionLayout.setCompressRowsRanges(org.openide.util.NbBundle.getMessage(PanelPublicLigtingOperatingRegime.class, "PanelPublicLigtingOperatingRegime.gridDimensionLayout.compressRowsRanges")); // NOI18N gridDimensionLayout.setRowSizeCompressed(new com.miginfocom.util.gfx.geometry.SizeSpec(new com.miginfocom.util.gfx.geometry.numbers.AtFixed(2.0f), new com.miginfocom.util.gfx.geometry.numbers.AtFixed(2.0f), new com.miginfocom.util.gfx.geometry.numbers.AtFixed(2.0f))); gridDimensionLayout.setRowSizeNormal(new com.miginfocom.util.gfx.geometry.SizeSpec(new com.miginfocom.util.gfx.geometry.numbers.AtFixed(10.0f), null, null)); Image of error is in attachment
Attachments:
napaka2.jpg [ 146.75 KiB | Viewed 5148 times ]
|
| Wed Jan 19, 2011 3:17 pm |
|
 |
|
MiG Support
Site Admin
Joined: Mon Dec 06, 2004 4:24 pm Posts: 2485 Location: Sweden
|
 Re: Time turns/change scroller problem
Hello,
We have a support ticket system on the site which is for paying customers. Please use that.
I will make sure this is answered here though since it would take a while to repost it there.
Cheers,
|
| Wed Jan 19, 2011 10:47 pm |
|
 |
|
rocky20
Joined: Wed Jan 19, 2011 2:35 pm Posts: 11
|
 Re: Time turns/change scroller problem
Hi again,
I'm stucked at this problem from almost i week, i tried everything, from copying dayTimeHeader, dayLayout from your demo, but with no sucess. I also tried to change many properties of headers, gridLayouts, and DateAreaBean properties but again with no sucess.
I' think now that this is some kind of bug. If i'm wrong please repair me. I will be very grateful if some one can help because i' dont know what to do anymore.
thanks in advance
|
| Thu Jan 27, 2011 5:39 pm |
|
 |
|
MiG Support
Site Admin
Joined: Mon Dec 06, 2004 4:24 pm Posts: 2485 Location: Sweden
|
 Re: Time turns/change scroller problem
Hello,
It seems that the shift is at the DST shift? This means that you might have a different time zone on the Activities and the Date Area. Maybe UTC in one of them?
It's important to use the same TimeZone in every DateRange you create. If you specify one the default will be used of course.
Thanks,
|
| Thu Jan 27, 2011 11:44 pm |
|
 |
|
rocky20
Joined: Wed Jan 19, 2011 2:35 pm Posts: 11
|
 Re: Time turns/change scroller problem
Hi! First of all thank you for your answer. Yes the problem happens at DST shift. I really doesnt have specified time zone in activities now i do it like this Code: TimeZone zone = TimeZone.getTimeZone("Europe/Ljubljana"); startDate.setTimeZone(zone); endDate.setTimeZone(zone);
ImmutableDateRange fullOperationRange = new ImmutableDateRange(startDate.getTime(), endDate.getTime(), true, zone, null);
For the DateArea is this the right way to specifiy the time zone Code: TimeZone zone = TimeZone.getTimeZone("Europe/Ljubljana"); DateRange visibleRange = new DateRange(startMillis, endMillis, true, zone, null); dateAreaPane.getDateArea().setVisibleDateRange(visibleRange); so now is everything set all of activities have this time zone: Activity:f_11_31 TimeZone Central European Time and DateAreaPane has this time zone DateAreaTimeZone: Central European Time But problem is still there nothing changed, should i set timezone to GridDimensionLayout somehow or to wesHeader i dont know?
|
| Fri Jan 28, 2011 10:15 am |
|
 |
|
MiG Support
Site Admin
Joined: Mon Dec 06, 2004 4:24 pm Posts: 2485 Location: Sweden
|
 Re: Time turns/change scroller problem
Hello,
It simply looks like the startDate and endDate are wrong. The time zone set on those will have no effect since a Date is just a millisecond reference basically.
Thanks,
|
| Fri Jan 28, 2011 11:09 pm |
|
 |
|
rocky20
Joined: Wed Jan 19, 2011 2:35 pm Posts: 11
|
 Re: Time turns/change scroller problem
the funny thing about that, (which i discovered later) is that if i have no activities on grid 8 hour morning also move up to 7 (just how we can see on picture). So i assumed that is something wrong with GridLayoutBean or westHeader and compress-Ranges wich are set to 0800-1600. I think there is a problem because there are compress-ranges and the time view passes 0:00 because in 24 hours view with no 0:00 time pass there is no problem.
The startDate and endDate must be right otherwise there will be no right title (start time and endtime on activities). i will try to put the scroller and compress ranges on your GridLineDemo to see if this is somekind of grid bug or there is something wrong with my application. (hope i will have time for this).
|
| Mon Jan 31, 2011 9:36 am |
|
 |
|
rocky20
Joined: Wed Jan 19, 2011 2:35 pm Posts: 11
|
 Re: Time turns/change scroller problem
Hello again!
Ok i have i little bit of time to change GridLineDemo.I Added some code from my application so that there is now the same error. gridLine moves up when DSTShift occur. when you scroll and dst shift occur, 8 hour moves up to 7 (last sunday in march), and 17 hour moves up to 16 (in october). I don't know if this error is somehow connected with wrapBoundaryType and count, this is just guesing i don't know anymore.
I added entire changed GridLineDemo project (zip) in attachments.
I will be very pleased if you can look at project. That we can get rid of this annoying error.
Thank you very much.
|
| Mon Jan 31, 2011 11:40 am |
|
 |
|
MiG Support
Site Admin
Joined: Mon Dec 06, 2004 4:24 pm Posts: 2485 Location: Sweden
|
 Re: Time turns/change scroller problem
Hello Which version of MigCalendar do you use? Please print what LicenseValidator.getComponentVersion() returns. You can download the latest version (6.8.  from our site. The last couple of versions have had some fixes for DST. Thanks,
|
| Mon Jan 31, 2011 10:40 pm |
|
 |
|
rocky20
Joined: Wed Jan 19, 2011 2:35 pm Posts: 11
|
 Re: Time turns/change scroller problem
Hello!
We were using 6.8.6 i changed now to 6.8.8 but the problem still exist. In GridDemoLine that i attached yesterday is also 6.8.8 version.
|
| Tue Feb 01, 2011 10:12 am |
|
 |
|
MiG Support
Site Admin
Joined: Mon Dec 06, 2004 4:24 pm Posts: 2485 Location: Sweden
|
 Re: Time turns/change scroller problem
Hello,
You need to post a support ticket.
Thanks,
|
| Fri Feb 04, 2011 12:10 am |
|
 |
|
rocky20
Joined: Wed Jan 19, 2011 2:35 pm Posts: 11
|
 Re: Time turns/change scroller problem
i already did it. Can you just tell me if it is bug or again my programming error. Thanks
|
| Fri Feb 04, 2011 11:18 am |
|
|
|
Page 1 of 1
|
[ 12 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
|
|