Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Request clues on enhancing our List view (Read 6132 times)
DamianC
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 16
Joined: Aug 19th, 2015
Request clues on enhancing our List view
Aug 19th, 2015 at 11:58am
Print Post  
Hi,

We're considering using JPlanner for our product. So far it looks good, but I just need a bit more control over a few things to make it ideal.

We're looking at something visual to help schedule vehicles and equipment for service or repairs. The "List" view is closest to what I want.

I have attached a screen shot of what I can do so far. It is good, but I need a bit more.

Can I ask for clues on how to ...
1. Make "today" obvious. Perhaps have a unique color.

2. Make weekends (Saturday & Sunday) obvious.

3. I would like to be able to have more control over each Appointment UI. Currently I can have multiple text lines - but I can't properly format the UI. Perhaps use our own JComponent? Then I can have more control over highlighting. In a perfect world I would like to ...
3.1 control the text formatting - eg bold, text size etc (HTML formatting would be ideal like a JLabel can)
3.2 color of the panel - so certain appointments can easily be identified as late, or urgent, or ready or whatever.

4. A custom UI for each day header. I still want the text "Wed 19 Aug" as is - but I also need to display much more information about each day. I need to indicate the day "status". The user would like to know if they have booked in too much that day, or all sorts of other information related to the day. Again, it would be ideal if I could use my own JComponent to get maximum control.

5. I notice that if there is an automatic horizontal scroll bar, but there is not an automatic vertical scroll bar. Is it possible to specify a vertical scroll bar if necessary?

Any thoughts would be much appreciated.

Many thanks,
-Damian
  

JPlannerTrial.jpg ( 108 KB | 148 Downloads )
JPlannerTrial.jpg
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Request clues on enhancing our List view
Reply #1 - Aug 19th, 2015 at 2:07pm
Print Post  
Hi,

You could implement 1 and 2 using DateStyle and DayOfWeekStyle objects:

Code
Select All
// set today's colors
DateStyle todayStyle = new DateStyle();
todayStyle.setFrom(DateTime.today());
todayStyle.setTo(DateTime.today());
todayStyle.setStyle(new Style());
todayStyle.getStyle().setBrush(new SolidBrush(Colors.Yellow));
calendar.getDayStyles().add(todayStyle);

// set weekend colors
DayOfWeekStyle sat = new DayOfWeekStyle();
sat.setDayOfWeek(DayOfWeek.Saturday);
sat.getStyle().setBrush(new SolidBrush(new Color(192, 100, 100)));
calendar.getDayOfWeekStyles().add(sat);
DayOfWeekStyle sun = new DayOfWeekStyle();
sun.setDayOfWeek(DayOfWeek.Sunday);
sun.getStyle().setBrush(new SolidBrush(new Color(192, 100, 100)));
calendar.getDayOfWeekStyles().add(sun); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Request clues on enhancing our List view
Reply #2 - Aug 19th, 2015 at 4:42pm
Print Post  
You can change the font and color of specific appointment by setting its Style:

Code
Select All
Style itemStyle = new Style();
itemStyle.setHeaderFont(new Font("Arial", 15, FontStyles.Italic));
itemStyle.setBrush(new SolidBrush(Colors.Red));
app.setStyle(itemStyle); 



You can change the defaults for all appointments by setting calendar.ItemSettings.Style.

The control has some support for html-like text formatting only for items' DescriptionText shown in timetable view. We'll try to implement it for HeaderText shown in list view for next release.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Request clues on enhancing our List view
Reply #3 - Aug 19th, 2015 at 5:20pm
Print Post  
4 is possible via custom drawing:

Code
Select All
calendar.getListViewSettings().setHeaderStyle(ListViewHeaderStyles.Title);
calendar.getListViewSettings().setHeaderSize(100);
calendar.getListViewSettings().getStyle().setHeaderTextAlignment(TextAlignment.TopCenter);

calendar.setCustomDraw(CustomDrawElements.ListViewHeaderCell);
calendar.addCalendarListener(new CalendarAdapter(){
	public void draw(DrawEvent e)
	{
		if (e.getElement() == CustomDrawElements.ListViewHeaderCell)
		{
			Brush brush = new SolidBrush(Colors.Black);

			RectangleD bounds = new RectangleD(e.getBounds().getX(), e.getBounds().getY(),
					e.getBounds().getWidth() - 1, e.getBounds().getHeight() - 1);

			e.getGraphics().drawString("more info", new Font("Arial", 10), brush, bounds);
		}
	}
}); 

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Request clues on enhancing our List view
Reply #4 - Aug 20th, 2015 at 8:19am
Print Post  
For #5 call ListViewSettings.setEnableVirtualItemSpace(true).

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
DamianC
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 16
Joined: Aug 19th, 2015
Re: Request clues on enhancing our List view
Reply #5 - Aug 20th, 2015 at 12:14pm
Print Post  
Hi Stoyan,
Fantastic responses. Much appreciated. I will be buying over the next few days.

Just a few issues ....

Regarding #5: There might be a bug here. As per your suggestion I tried calendar.getListViewSettings().setEnableVirtualItemSpace(true);. When the screen first appears there is no vertical scroll bar, even if it needs one. However, if I MOVE any Appointment the vertical scroll bar appears.

Also, with DayOfWeekStyle and DateStyle I have a nice background color for Weekends and "today". The other days have a grey background that I would like to edit. Where can I set the default background? I've tried in a few places, but with no luck.

Again, many thanks for your outstanding feedback.
-Damian
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Request clues on enhancing our List view
Reply #6 - Aug 20th, 2015 at 3:23pm
Print Post  
Hi Damian,

Calling Calendar.update() after first resize seems to fix the vertical scrollbar:

Code
Select All
calendar.addComponentListener(new ComponentAdapter() {
   @Override
   public void componentResized(ComponentEvent e) {
    super.componentResized ( e );
    calendar.update();
   }
  }); 



You can change the background of the whole view by calling
Code
Select All
ListViewSettings.getStyle().setBrush(Brushes.Orange); 



or cells and headers background:
Code
Select All
settings.getCellSettings().getStyle().setBrush(Brushes.Red);
settings.getCellSettings().getStyle().setHeaderBrush(Brushes.DarkSlateBlue); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
DamianC
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 16
Joined: Aug 19th, 2015
Re: Request clues on enhancing our List view
Reply #7 - Aug 21st, 2015 at 12:18pm
Print Post  
Hi Stoyan,
There is certainly no bug. It was just the primitive way I was trialing. It does work properly in any realistic situation.

I have now purchased. Is the "production" jar different from the trial jar? Do I need to replace the jar?

I am very happy with the product and the support.

Many thanks.
- Damian
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Request clues on enhancing our List view
Reply #8 - Aug 21st, 2015 at 12:21pm
Print Post  
Hi Damian,

You don't have to replace the jar, but instead call the Calendar.setLicenseKey method with the Keycode you received from SWREG as argument.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint