Skip to main content

JXMonthView component

11 replies [Last post]
Anonymous

Some issues.

JXMonthView monthView = new JXMonthView();
monthView.setPreferredCols(2);
monthView.setPreferredRows(2);

JFrame frame = new JFrame();
frame.getContentPane().add(monthView);
frame.pack();
frame.setVisible(true);

Won't work as expected, it will show 2x2 calendar, but more calendars appears when user resize the window.

I think that setPreferredCols and setPreferredRows should prevent calendar from displaying more columns

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dmouse
Offline
Joined: 2003-06-09
Points: 0

> I've just dropped the new jar, docs, and sources into
> my public server:
>
> http://ronaldtm.no-ip.org:8800/SwingExtensions/

Awesome! I just downloaded it and will take a look at it shortly.

> I've added the selection model, and support to change
> the first day of the week (for the calendar model and
> selection model independently). Now, we have two
> models, one for the visualization of the calendar (in
> practice it serves only for the JDayChooser to know
> whats the current month, I don't know if its worth
> keep), and one for the selection (single, multiple,
> week selection).
>
> Ah, Joshua, sorry, I took your week selection code
> (mine was ugly) :)

That's what it's there for. Glad you found it useful. :)

> Please, take a look and give me your feedback!
>
> Tetsuo

Anonymous

I saw new JXDatePicker.
And open a new topic for it :-)

Anonymous

About DatePicker.
I know that DataPicker component just a place holder.
And my question was - Are you (or someone else) is going to implement it ?
Of course using JXMonthView as popup calendar.
I am asking it because I need one.
If somone is working on it it is great, but if not, I will do my own.

About SetMaximumCols/Rows - I think that it is a good idea.
You right that we can fix the size and calendar won't draw more blocks, but sometimes it would be nice to have hard restriction on Cols/Rows.

dmouse
Offline
Joined: 2003-06-09
Points: 0

I do have an implementation right now, but it is quite rough. In my opinion it needs more work before it goes back. It could possibly go in the sandbox in the meantime to get more hands working on it.

Regarding the setMaximumCols/Rows, it is my opinion that the component would then not resize past those values.

Adding padding between the calendars could result in very spaced out calendars and look very ugly. The behavior of resizing the app and having this spacing change dynamically also is very disturbing to users. Plus, this padding can be controlled programatically.

The other option of insetting the component would result in the calendars painting in the center of the component and be surrounded by white, or whatever the background was. This sounds ugly to me as well. If this were what the programmer wanted there are still other ways to accomplish this.

My vote is for keeping the set[Preferred/Maximum][Cols/Rows] methods to match simliar to the set[Preferred/Maximum]Size methods. I just want to bring up some of the cons of the other approached, but please follow up if you feel these issues are unwarranted or if there are issues with my approach.

Josh

Anonymous

> I do have an implementation right now, but it is
> quite rough. In my opinion it needs more work before
> it goes back. It could possibly go in the sandbox in
> the meantime to get more hands working on it.
I can help with it, if you have any place to put it tell me where is it?
If not, you can mail the code to me, and I will send you back what I did in a day, two, for review.
Make no sense for me to start my own from scratches when I can contribute my time and improve existing one.

> My vote is for keeping the
> set[Preferred/Maximum][Cols/Rows] methods to match
> simliar to the set[Preferred/Maximum]Size methods. I
> just want to bring up some of the cons of the other
> approached, but please follow up if you feel these
> issues are unwarranted or if there are issues with my
> approach.
Ok, I agree with you.

dmouse
Offline
Joined: 2003-06-09
Points: 0

I'm getting a review from some people first and then once I put in stub functions and fix quick issues I'll put it up in the JDNC project. It should be within a few days.

ronaldtm
Offline
Joined: 2003-07-18
Points: 0

I've just dropped the new jar, docs, and sources into my public server:

http://ronaldtm.no-ip.org:8800/SwingExtensions/

I've added the selection model, and support to change the first day of the week (for the calendar model and selection model independently). Now, we have two models, one for the visualization of the calendar (in practice it serves only for the JDayChooser to know whats the current month, I don't know if its worth keep), and one for the selection (single, multiple, week selection).

Ah, Joshua, sorry, I took your week selection code (mine was ugly) :)

Please, take a look and give me your feedback!

Tetsuo

ronaldtm
Offline
Joined: 2003-07-18
Points: 0

Oooops, sorry, I've used the names hardcoded in portuguese!

DOM = Domingo = Sunday
SEG = Segunda = Monsday
TER = Terça = Tuesday
QUA = Quarta = Wednesday
QUI = Quinta = Thursday
SEX = Sexta = Friday
SAB = Sábado = Saturday

Tetsuo

dmouse
Offline
Joined: 2003-06-09
Points: 0

Ivan,

I believe this is the correct way for it to function. It's the preferred cols/rows, not the maximum. So if the component is given more area to paint in it will.

I believe the correct way to solve this problem is for the app developer to set the maximum size of the component to be the value of the preferred size. Another solution it to place the component in a panel that does not resize. It is also possible that we may want to add a convenience method setMaximumCols/Rows.

What do you think?

Josh

Ronald Tetsuo Miura

I agree. But then, if the maximum cols/rows was reached, what the individual calendars should do? Expand itself, or expand the padding between them (+1)?

=================
>De:jdnc-interest@javadesktop.org
>Para:jdnc@jdnc.dev.java.net
>Assunto:Re: JXMonthView component
>
>Ivan,
>
>I believe this is the correct way for it to
>function. It's the preferred cols/rows, not the
>maximum. So if the component is given more area
>to paint in it will.
>
>I believe the correct way to solve this problem
>is for the app developer to set the maximum size
>of the component to be the value of the
>preferred size. Another solution it to place
>the component in a panel that does not resize.
>It is also possible that we may want to add a
>convenience method setMaximumCols/Rows.
>
>What do you think?
>
>Josh
>---
>[Message sent by forum member 'dmouse' (Joshua
>Outwater)]
>
>http://www.javadesktop.org/forums/thread.jspa?me
>ssageID=21759哿
>
>------------------------------------------------
>---------------------
>To unsubscribe, e-mail:
>jdnc-unsubscribe@jdnc.dev.java.net
>For additional commands, e-mail:
>jdnc-help@jdnc.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

Anonymous

> I agree. But then, if the maximum cols/rows was
> reached, what the individual calendars should do?
> Expand itself, or expand the padding between them
> (+1)?

Increase the padding. I think that it is a right behaviour for it.