Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-04-2008, 06:54 AM
Member
 
Join Date: Jan 2008
Posts: 81
Preethi is on a distinguished road
Problem in repaint
I'm doing a program in JApplet.In that i have a problem in
dragging the shape...I can able to drag but the previous position remains in the same
place,only a copy of it is,dragged..I'm calling the repaint method,even then i have this problem
please help me
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-06-2008, 05:27 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,189
hardwired is on a distinguished road
Can you show us your code?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-10-2008, 11:17 AM
Member
 
Join Date: Jan 2008
Posts: 81
Preethi is on a distinguished road
Quote:
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.FileNotFoundException;

import java.io.IOException;
import java.sql.Time;

import java.text.*;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.swing.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;




public class mousedrag extends javax.swing.JApplet {


@Override
public void init() {
Container cont = getContentPane();
cont.setLayout(new BorderLayout());
setPreferredSize(new Dimension(300, 300));

JScrollPane scroll = new JScrollPane();
getContentPane().add(scroll, BorderLayout.CENTER);
scroll.getViewport().add(new Imagepanel());
}

private class Imagepanel extends JPanel implements MouseListener,MouseMotionListener{
public static final long serialVersionUID = 0;

public Imagepanel()
{
panel();
addMouseMotionListener(this);
addMouseListener(this);

}


public void panel()
{
Graphics g1 = this.g;
int dimension =0 ;

setPreferredSize(new Dimension(33060,33060));
setBorder(BorderFactory.createLineBorder(Color.BLA CK, border));
}

@Override
public void paint(Graphics g)
{
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASIN G, RenderingHints.VALUE_ANTIALIAS_ON);

g2.setColor(getBackground());
g2.fillRect(0, 0, getWidth(), getHeight());
g2.setColor(getForeground());


if(drawpanel){drawPanel(g2);}
if(drawresource){drawResource(g2);}
if(drawcalender)
{
drawCalendar(g2);
}




}

public void drawPanel(Graphics g){
int margin = 10;
int imgborder = 10;
int imgline1 = 300;
int titlebarx = 300;
int titlebary = 50;
Graphics2D g2 = (Graphics2D) g;
//g2.setRenderingHint(RenderingHints.KEY_ANTIALIASIN G, RenderingHints.VALUE_ANTIALIAS_ON);

g2.drawLine(imgline1, 0, imgline1, getHeight());
g2.setPaint(new Color(0, 128, 192));
g2.fillRect(imgborder, imgborder, 290, 45);
g2.setPaint(Color.WHITE);

g2.drawLine(margin, margin, titlebarx, titlebary);
g2.drawString("RESOURCE", 40, 40);
g2.drawString("TIME", 200, 25);
}
public void drawResource(Graphics g){

}

public Date drawCalendar( Graphics g){



}

public Date [] drawwrk(Graphics g)
{

}



public void mouseClicked(MouseEvent e)
{

}

public void drawdig(Graphics g)
{
Graphics2Dn g2 = (Graphics2D)g;
g2.setPaint(new Color(0,157,250));
System.out.println(rectangles.size()+"SIZE");
for(Rectangle ret : rectangles)
{
g2.draw(ret);
g2.fill(ret);

}


}


public void mousePressed(MouseEvent e)
{

}

public void mouseReleased(MouseEvent e) {

}

public void mouseEntered(MouseEvent e) {}

public void mouseExited(MouseEvent e) {}



public void mouseDragged(MouseEvent e)

public void mouseDragged(MouseEvent e)
{
Point p = e.getPoint();
Rectangle[] r = rectangles.toArray(new Rectangle[rectangles.size()]);
for(int i=0, j = rectangles.size(); i<j ; i++)
{
Point lastP = (Point)lastPos.get(r[i]);
if(r[i].contains(p))
{
int new_x = (e.getX()+(int)r[i].getX()) - (int)r[i].getX();
r[i].translate(new_x, e.getY());

}

lastPos.put(r[i], p);


}
}
repaint();

}
public void actionPerformed(MouseEvent e)
{

}
public void mouseMoved(MouseEvent e)
{

lastPos.clear();

}

}

}

Please help,me
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 03-10-2008, 03:31 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,189
hardwired is on a distinguished road
Code:
// <applet code="MDRx" width="400" height="400"></applet> import java.awt.*; import java.awt.event.*; import javax.swing.*; public class MDRx extends JApplet { @Override public void init() { Container cont = getContentPane(); cont.setLayout(new BorderLayout()); setPreferredSize(new Dimension(300, 300)); JScrollPane scroll = new JScrollPane(); getContentPane().add(scroll, BorderLayout.CENTER); scroll.getViewport().add(new Imagepanel()); } private class Imagepanel extends JPanel implements MouseListener, MouseMotionListener { Rectangle[] rects; Rectangle selectedRect; Point offset = new Point(); boolean dragging = false; public Imagepanel() { rects = new Rectangle[2]; rects[0] = new Rectangle(25, 25, 100, 100); rects[1] = new Rectangle(200, 150, 150, 100); setPreferredSize(new Dimension(//33060,33060)); 400, 400)); setBorder(BorderFactory.createLineBorder(Color.BLACK)); addMouseMotionListener(this); addMouseListener(this); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setColor(getBackground()); g2.fillRect(0, 0, getWidth(), getHeight()); g2.setColor(getForeground()); // drawPanel(g2); drawRects(g2); } public void drawPanel(Graphics2D g2) { int margin = 10; int imgborder = 10; int imgline1 = 300; int titlebarx = 300; int titlebary = 50; g2.drawLine(imgline1, 0, imgline1, getHeight()); g2.setPaint(new Color(0, 128, 192)); g2.fillRect(imgborder, imgborder, 290, 45); g2.setPaint(Color.WHITE); g2.drawLine(margin, margin, titlebarx, titlebary); g2.drawString("RESOURCE", 40, 40); g2.drawString("TIME", 200, 25); } public void drawRects(Graphics2D g2) { g2.setPaint(new Color(0,157,250)); for(Rectangle ret : rects) { g2.draw(ret); // g2.fill(ret); } } public void mousePressed(MouseEvent e) { Point p = e.getPoint(); for(int j = 0; j < rects.length; j++) { if(rects[j].contains(p)) { selectedRect = rects[j]; offset.x = p.x - rects[j].x; offset.y = p.y - rects[j].y; dragging = true; break; } } } public void mouseReleased(MouseEvent e) { dragging = false; } public void mouseDragged(MouseEvent e) { if(dragging) { int new_x = e.getX() - offset.x; int new_y = e.getY() - offset.y; selectedRect.setLocation(new_x, new_y); repaint(); } } public void mouseClicked(MouseEvent e) {} public void mouseEntered(MouseEvent e) {} public void mouseExited(MouseEvent e) {} public void mouseMoved(MouseEvent e) {} } }
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 03-11-2008, 07:25 AM
Member
 
Join Date: Jan 2008
Posts: 81
Preethi is on a distinguished road
Still i have the same problem...Please help me
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 03-11-2008, 06:25 PM
Senior Member
 
Join Date: Jul 2007
Posts: 1,189
hardwired is on a distinguished road
I can able to drag but the previous position remains in the same
place,only a copy of it is,dragged

...
Still i have the same problem
The applet posted above (post 4) does not show this behavior. To run it with the appletviewer from the prompt use:
Code:
prompt>appletviewer MDRx.java
One difficulty in developing applets with an html file is that the Java plug–in and some browsers cache the applet and will not check for or use updated class files. You end up having to change the file name for each change. The appletviewer tool will use the current/latest class files.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 03-12-2008, 09:26 AM
Member
 
Join Date: Jan 2008
Posts: 81
Preethi is on a distinguished road
I tried in that way too...But its still showing the same error...
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 03-13-2008, 07:48 AM
Member
 
Join Date: Jan 2008
Posts: 81
Preethi is on a distinguished road
package saxExamples;


import javax.swing.*;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Time;
import java.text.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.swing.*;
import org.xml.sax.*;
import org.xml.sax.helpers.*;




public class mousedrag extends javax.swing.JApplet
{
ArrayList <BasicDom> x_list ;

int xPos,yPos;
public mousedrag()
{
mousedrag.Imagepanel image = new mousedrag.Imagepanel();
x_list = image.getData();
}
@Override
public void init() {
Container cont = getContentPane();


cont.setLayout(new BorderLayout());
setPreferredSize(new Dimension(300, 300));

JScrollPane scroll = new JScrollPane();
getContentPane().add(scroll, BorderLayout.CENTER);
scroll.getViewport().add(new Imagepanel());
}

private class Imagepanel extends JPanel implements MouseListener,MouseMotionListener
{
public static final long serialVersionUID = 0;

Imagepanel image;

private int border = 2;

boolean selected= false;
boolean selected1= false;

/*Iterator for drawing the resource tree(for the tag<res_mseg>)*/
private Iterator<DataObject> it;
/*Iteartor for the work order attribute in the tag <rev_mseg>*/
private Iterator<DrawingData> it_wrk_drawing;
/*Iterator for the attribute wo_from_date in the tag <rev_mseg>*/
private Iterator<FromDateData> it_frmdate;
/*Iterator for the attribute wo_to_date in the tag <rev_mseg>*/
private Iterator<ToDateData> it_todate;

protected ArrayList<DataObject> res_mseg;
protected ArrayList<DrawingData> rev_list;
protected ArrayList<FromDateData> frm_list;
protected ArrayList<WrkorderData> wrk ;
ArrayList<ToDateData> todate_list;
ArrayList<FromTime>fromtime_list;
ArrayList<ToTime> totime_list;
ArrayList<FromDateData> frmdate_list = new ArrayList<FromDateData>();
boolean drawpanel = true;
boolean drawresource = true;
boolean drawcalender = true;
boolean canDrag = false;
public Date date1;
ArrayList str_wrk = new ArrayList();
ArrayList <Date>str_frmdate ;
ArrayList <Date>str_todate = new ArrayList<Date>();
ArrayList <Date>str_frmtime = new ArrayList<Date>();
ArrayList <Date>str_totime = new ArrayList<Date>();
ArrayList resno_list = new ArrayList ();
int noday;
int no_of_days;
Date fromDate;
Graphics g;
MouseEvent e;
int rect_x;
int rect_y;
int rect_w;
int rect_ht;
int x,y,w,ht;
//Rectangle r = new Rectangle();
int r_x=100;
int r_y =100;
int r_w =15;
int r_ht = 10;
Rectangle r1 = new Rectangle(r_x,r_y,r_w,r_ht);
ArrayList<Integer> x_cord_list = new ArrayList<Integer>();
ArrayList<Integer> y_cord_list = new ArrayList<Integer>();
ArrayList<Integer> width_list = new ArrayList<Integer> ();
ArrayList<Rectangle> rectangles = new ArrayList<Rectangle> ();
ArrayList<Rectangle> rectangle = new ArrayList<Rectangle> ();
Rectangle clickedRectangle = null;
Rectangle r = new Rectangle(rect_x,rect_y,rect_w,rect_ht);
Rectangle [] panel;
//mousedrag.Imagepanel[] panel ;
Map <Rectangle , Point > lastPos = new HashMap <Rectangle ,Point > ();
int x_Pos,y_Pos;
// JOptionPane optionpane = new JOptionPane();
JPanel optpane = new JPanel();

Rectangle selectedRect;
Point offset = new Point();
boolean dragging = false;
Rectangle[] rects;

public Imagepanel()
{
panel();
addMouseMotionListener(this);
addMouseListener(this);

}


public void panel()
{
Graphics g1 = this.g;
int dimension =0 ;

setPreferredSize(new Dimension(33060,33060));

Imagepanel imagepanel ;
setBorder(BorderFactory.createLineBorder(Color.BLA CK, border));
}

@Override
public void paint(Graphics g)
{
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASIN G, RenderingHints.VALUE_ANTIALIAS_ON);

g2.setColor(getBackground());
g2.fillRect(0, 0, getWidth(), getHeight());
g2.setColor(getForeground());


if(drawpanel){drawPanel(g2);}
if(drawresource){drawResource(g2);}
if(drawcalender)
{
drawCalendar(g2);
}


g2.setPaint(new Color(0,157,250));
System.out.println(rectangles.size()+"SIZE");
rects = rectangles.toArray(new Rectangle[rectangles.size()]);
for(Rectangle ret : rects)
//for(Rectangle ret : rectangles)
{
g2.draw(ret);
//g2.fill(ret);

}

}

public void drawPanel(Graphics g){
int margin = 10;
int imgborder = 10;
int imgline1 = 300;
int titlebarx = 300;
int titlebary = 50;
Graphics2D g2 = (Graphics2D) g;
//g2.setRenderingHint(RenderingHints.KEY_ANTIALIASIN G, RenderingHints.VALUE_ANTIALIAS_ON);

g2.drawLine(imgline1, 0, imgline1, getHeight());
g2.setPaint(new Color(0, 128, 192));
g2.fillRect(imgborder, imgborder, 290, 45);
g2.setPaint(Color.WHITE);

g2.drawLine(margin, margin, titlebarx, titlebary);
g2.drawString("RESOURCE", 40, 40);
g2.drawString("TIME", 200, 25);
}
public void drawResource(Graphics g){
int x_axis= 50;
int y_axis = 80;
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASIN G, RenderingHints.VALUE_ANTIALIAS_ON);

XMLReading xmlreadingObj = new XMLReading();
try {
xmlreadingObj.fileParsing("C:/Documents and Settings/8563/TEST/src/Gantt.xml");
} catch (FileNotFoundException ex) {
ex.printStackTrace();
} catch (SAXException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}

it = xmlreadingObj.getres_list().iterator();
it_wrk_drawing = xmlreadingObj.getrev__wrkOrder_list().iterator();
it_frmdate = xmlreadingObj.getrev_frmdate_list().iterator();
it_todate = xmlreadingObj.getrev_todate_list().iterator();
int size = xmlreadingObj.getres_list().size();
//System.out.print("res"+size);
g2.setPaint(new Color(0, 128, 192));
//int y_line = 93;
int y_rect = 72;
int tree_rect_width = 13;
int tree_rect_height = 10;
int panel_line_x = 300;
for (int len=0;len<size;len++)
{
while(it.hasNext()) {
Font font_resourcetrees = new Font("Ariel",Font.PLAIN,9);
g2.setFont(font_resourcetrees);
g2.fillRect(30,y_rect,tree_rect_width,tree_rect_he ight);

g2.drawLine(panel_line_x,y_axis+14,getWidth(),y_ax is+14);
g2.drawString(""+it.next(),x_axis,y_axis);

/*line for seperating the resource*/
y_axis += 28;

y_rect += 28;
//y_line +=34;
}
}
}

public Date drawCalendar( Graphics g){

Graphics2D g2 = (Graphics2D)g;
//g2.setRenderingHint(RenderingHints.KEY_ANTIALIASIN G, RenderingHints.VALUE_ANTIALIAS_ON);
//int nodays = date_difference(g2);
int no_ofday = this.no_of_days;
long from;
long to;
int n = 168;
int x = 300;
int x1_cal = 300;
int x3 = x;
int width1 = 180;
int daydx = (width1 / 2);
int dayx = (daydx + x);
int f2 = x + n;
String date[] = {"0", "4", "8", "12", "16", "20", "24"};

int total_no_days = date_difference(g2);
//System.out.println("from calendar"+total_no_days);
long days =(long) total_no_days;
no_ofday = (int) days ;

Date [] arraydate = drawwrk(g2);
g2.setPaint(Color.BLACK);
Calendar c = Calendar.getInstance(); // current date*
Calendar c1 = Calendar.getInstance();
Date local_fromDate = arraydate[0];
//System.out.println(fromDate +"frmdat:From calendar");

Date toDate = arraydate[arraydate.length-1];
c.setTime(local_fromDate);

for (int i = 0; i < no_ofday; i++) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
SimpleDateFormat sdf1 = new SimpleDateFormat("EEE");
// use the pattern: day_of_month
String str = sdf.format(c.getTime()); // fromat the date to string
String str3 = sdf1.format(c1.getTime());
for (int j = 0; j < 6; j++)
{
Font font1 = new Font("Ariel", Font.PLAIN, 9);
g2.setFont(font1);
g2.drawLine(x1_cal, 50, x1_cal, 55);
g2.drawString(date[j], x1_cal, 45);
x1_cal += 30;
}
g2.drawRect(x, 10, width1, 45);
g2.drawString("24", f2, 45);
f2 += width1;
x += width1;
g2.drawString(str, dayx-10, 35);
g2.drawString(str3,dayx-5,20);
dayx += 180;
int nextdate = c.get(Calendar.DATE) + 1;
c.set(Calendar.DATE, nextdate);
int nextdate1 = c1.get(Calendar.DAY_OF_WEEK)+1;
c1.set(Calendar.DAY_OF_WEEK,nextdate1);

}
return local_fromDate;


}

/*This method make the datas in the list in a order.
It computes the date and time from the list..
And it return the start date and end date & this was used in calender method*/
public Date [] drawwrk(Graphics g)
{
Graphics2D g2 = (Graphics2D)g;
XMLReading xmlreadingObj = new XMLReading();

try
{
xmlreadingObj.fileParsing("C:/Documents and Settings/8563/TEST/src/Gantt.xml");
} catch (FileNotFoundException ex)
{
ex.printStackTrace();
} catch (SAXException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}

res_mseg = xmlreadingObj.res_list;
Object [] array = res_mseg.toArray();

rev_list = xmlreadingObj.rev__wrkOrder_list;
Object [] array1 = rev_list.toArray();

String str1 = new String();
String str2 = new String();

wrk = xmlreadingObj.wrkorder_list;
frm_list = xmlreadingObj.rev_frmdate_list;
todate_list = xmlreadingObj.rev_todate_list;
fromtime_list = xmlreadingObj.rev_frmtime_list;
totime_list = xmlreadingObj.rev_totime_list;

Date frmdate = new Date();
Date todate = new Date();

Date frm_time = null;
Date to_time = null;
Time frmTime = null;
Time toTime = null;
Date startdate= null;

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf_time = new SimpleDateFormat("HH:mm:ss");
int delay =(1000*60*60*24);
Calendar c2 = Calendar.getInstance();
Calendar c3 = Calendar.getInstance();
int ftime = 0;
int ttime = 0;
int dif = 0;
int x_1 = 0;
int fromdate =0;
int to_date =0;


int size = res_mseg.size();
int size1 = rev_list.size();
ArrayList res_list = new ArrayList();
String strtdate = frm_list.get(0).toString();

String [] str_array = new String[size];
String [] str1_array = new String[size1];

double x_time;
double y_time;
double x1 ;
double x2;
int y_1 =80;
int y_axis = 74;
int x_cord = this.rect_x;
//int y_axis = this.rect_y;
int width = this.rect_w;


str_frmdate = new ArrayList<Date>();
for(int len = 0; len < array.length; len++)
{
int i =0;
int j =0;
str1 = array[len].toString();
str_array [i] = str1;
res_list.add(str1);

for(int len1 = 0; len1 < array1.length; len1++)
{

str2 = array1[len1].toString();
str1_array [j] = str2;
if(str1.compareToIgnoreCase(str2) == 0 )
{
resno_list.add(str2);
str_wrk.add(wrk.get(len1));
String str_date = frm_list.get(len1).toString();
String date_todate = todate_list.get(len1).toString();
String totime = totime_list.get(len1).toString();
String frmtime = fromtime_list.get(len1).toString();
try
{
frmdate = sdf.parse(str_date);
todate = sdf.parse(date_todate);


frm_time = sdf_time.parse(frmtime);
to_time = sdf_time.parse(totime);
}
catch (ParseException ex) {
ex.printStackTrace();
}
c2.setTime(frm_time);
c3.setTime(to_time);
ftime = c2.get(Calendar.HOUR_OF_DAY);
ttime = c3.get(Calendar.HOUR_OF_DAY);
int time_diff = ttime - ftime;

fromdate = Math.round((frmdate.getTime())/delay);
to_date = Math.round((todate.getTime())/delay);

str_frmtime.add(frm_time);
str_totime.add(to_time);
str_frmdate.add(frmdate);
str_todate.add(todate);

long datediff =((( todate.getTime())/delay)-((difference().getTime())/delay));
long convr_datediff =(datediff*180)+300;

/*calculating x-co_ordinate*/
double hour = ftime*7.5;
double x_hr = hour +convr_datediff;
int conversion = (int)Math.round(x_hr);
x_cord = conversion;

/*calculating width*/
double x_2 = ttime *7.5;
double timediff = x_2 - hour;
int width_hr =(int) Math.round(timediff);
width =width_hr;
//int width =width_hr;
try
{
//drawRectangle(x_cord,y_axis,width,15);
//g2.setPaint(new Color(0, 128, 192));

x_cord_list.add(x_cord);
y_cord_list.add(y_axis);
width_list.add(width);
//Rectangle rt = new Rectangle(x_cord,y_axis,width,15);
rectangles.add(new Rectangle(x_cord,y_axis,width,15));
//rectangles.add(rt);

// r.setBounds(x_cord,y_axis,width,15);
// g2.fill(r);
}
catch(Exception e2){
System.out.print("EXCEPTION");
}
//g2.drawRect(x_cord,y_axis,width,10);


// catch (ParseException ex) {
// ex.printStackTrace();
// }
}
// y_axis += 28;
}
y_axis += 28;
//System.out.println(y_axis);

}

Date [] sorted_frmDate = (Date [])str_frmdate.toArray(new Date[str_frmdate.size()]);
Date [] sorted_toDate = (Date [])str_todate.toArray(new Date[str_todate.size()]);
java.util.Arrays.sort(sorted_frmDate);
java.util.Arrays.sort(sorted_toDate);

startdate = sorted_frmDate[0];
Date enddate = sorted_toDate[sorted_toDate.length-1];
//Date []myDate = new Date [] {startdate,enddate};
//return myDate;
return new Date [] {startdate,enddate};
}

public int date_difference(Graphics g)
{
int noofdays= this.no_of_days;
Date [] date = null;
Graphics2D g2 = (Graphics2D)g;

long difference = 0;
try
{
date = drawwrk(g2);
}
catch(NullPointerException nullptr_e){

}
Date startDate = date[0];
Date endDate = date[date.length-1];
Calendar c = Calendar.getInstance();
Calendar c1 = Calendar.getInstance();
c.setTime(startDate);
c1.setTime(endDate);
difference = (c1.getTime().getTime() - c.getTime().getTime());
long total_no_days = Math.round((difference)/(1000*60*60*24));
no_of_days = (int)total_no_days+1;

//this.no_of_days = no_of_days;
return this.no_of_days;
//return no_of_days;
}
public Date difference()
{
Date dt = str_frmdate.get(0);
return dt;
}
public ArrayList getfrmDate()
{
return str_frmdate;
}
public void mouseClicked(MouseEvent e)
{

}
public void drawdig(Graphics2D g2)
{
g2.setPaint(new Color(0,157,250));
for(Rectangle ret : rectangles)
{
g2.draw(ret);
}
}
public void mousePressed(MouseEvent e)
{
Point p = e.getPoint();
xPos = e.getX();
yPos = e.getY();
//Rectangle[] rects = rectangles.toArray(new Rectangle[rectangles.size()]);
for(int j = 0; j < rects.length; j++)
{
if(rects[j].contains(p))
{
//selectedRect = rects[j];
offset.x = p.x - rects[j].x;
offset.y = p.y - rects[j].y;
dragging = true;
break;
}
}

}

public void mouseReleased(MouseEvent e)
{
rectangles.clear();
dragging = false;
}
public void mouseEntered(MouseEvent e) {}
public void mouseExited(MouseEvent e) {}
public void mouseDragged(MouseEvent e)
{
if(dragging)
{
int new_x = e.getX() - offset.x;
int new_y = e.getY() - offset.y;
selectedRect.setLocation(new_x, new_y);
repaint();
}

}
public void actionPerformed(MouseEvent e)
{

}
public void mouseMoved(MouseEvent e)
{

}
public ArrayList<BasicDom> getData()
{
return x_list;
}
public void printData()
{
Iterator itr = x_list.iterator();

while(itr.hasNext())
{
System.out.println(it.next());
}
}
}

}
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 03-14-2008, 06:52 AM
Member
 
Join Date: Jan 2008
Posts: 81
Preethi is on a distinguished road
Code:
package saxExamples; import javax.swing.*; import java.awt.*; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.event.*; import java.awt.geom.*; import java.io.FileNotFoundException; import java.io.IOException; import java.sql.Time; import java.text.*; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import javax.swing.*; import org.xml.sax.*; import org.xml.sax.helpers.*; public class mousedrag extends javax.swing.JApplet { @Override public void init() { Container cont = getContentPane(); cont.setLayout(new BorderLayout()); setPreferredSize(new Dimension(300, 300)); JScrollPane scroll = new JScrollPane(); getContentPane().add(scroll, BorderLayout.CENTER); scroll.getViewport().add(new Imagepanel()); } private class Imagepanel extends JPanel implements MouseListener,MouseMotionListener { public static final long serialVersionUID = 0; private int border = 2; boolean selected= false; boolean selected1= false; /*Iterator for drawing the resource tree(for the tag<res_mseg>)*/ private Iterator<DataObject> it; /*Iteartor for the work order attribute in the tag <rev_mseg>*/ private Iterator<DrawingData> it_wrk_drawing; /*Iterator for the attribute wo_from_date in the tag <rev_mseg>*/ private Iterator<FromDateData> it_frmdate; /*Iterator for the attribute wo_to_date in the tag <rev_mseg>*/ private Iterator<ToDateData> it_todate; protected ArrayList<DataObject> res_mseg; protected ArrayList<DrawingData> rev_list; protected ArrayList<FromDateData> frm_list; protected ArrayList<WrkorderData> wrk ; ArrayList<ToDateData> todate_list; ArrayList<FromTime>fromtime_list; ArrayList<ToTime> totime_list; ArrayList<FromDateData> frmdate_list = new ArrayList<FromDateData>(); boolean drawpanel = true; boolean drawresource = true; boolean drawcalender = true; boolean canDrag = false; public Date date1; ArrayList str_wrk = new ArrayList(); ArrayList <Date>str_frmdate ; ArrayList <Date>str_todate = new ArrayList<Date>(); ArrayList <Date>str_frmtime = new ArrayList<Date>(); ArrayList <Date>str_totime = new ArrayList<Date>(); ArrayList resno_list = new ArrayList (); int noday; int no_of_days; Date fromDate; Graphics g; MouseEvent e; int rect_x; int rect_y; int rect_w; int rect_ht; int x,y,w,ht; //Rectangle r = new Rectangle(); int r_x=100; int r_y =100; int r_w =15; int r_ht = 10; Rectangle r1 = new Rectangle(r_x,r_y,r_w,r_ht); ArrayList<Integer> x_cord_list = new ArrayList<Integer>(); ArrayList<Integer> y_cord_list = new ArrayList<Integer>(); ArrayList<Integer> width_list = new ArrayList<Integer> (); ArrayList<Rectangle> rectangles = new ArrayList<Rectangle> (); ArrayList<Rectangle> rectangle = new ArrayList<Rectangle> (); Rectangle clickedRectangle = null; Rectangle r = new Rectangle(rect_x,rect_y,rect_w,rect_ht); Rectangle [] panel; int x_Pos,y_Pos; Rectangle selectedRect; Point offset = new Point(); boolean dragging = false; Rectangle[] rects; public Imagepanel() { panel(); addMouseMotionListener(this); addMouseListener(this); } public void panel() { Graphics g1 = this.g; int dimension =0 ; setPreferredSize(new Dimension(33060,33060)); Imagepanel imagepanel ; setBorder(BorderFactory.createLineBorder(Color.BLACK, border)); } @Override public void paint(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2.setColor(getBackground()); g2.fillRect(0, 0, getWidth(), getHeight()); g2.setColor(getForeground()); if(drawpanel){drawPanel(g2);} if(drawresource){drawResource(g2);} if(drawcalender) { drawCalendar(g2); } g2.setPaint(new Color(0,157,250)); System.out.println(rectangles.size()+"SIZE"); rects = rectangles.toArray(new Rectangle[rectangles.size()]); for(Rectangle ret : rects) { g2.draw(ret); } } public void drawPanel(Graphics g){ int margin = 10; int imgborder = 10; int imgline1 = 300; int titlebarx = 300; int titlebary = 50; Graphics2D g2 = (Graphics2D) g; g2.drawLine(imgline1, 0, imgline1, getHeight()); g2.setPaint(new Color(0, 128, 192)); g2.fillRect(imgborder, imgborder, 290, 45); g2.setPaint(Color.WHITE); g2.drawLine(margin, margin, titlebarx, titlebary); g2.drawString("RESOURCE", 40, 40); g2.drawString("TIME", 200, 25); } public void drawResource(Graphics g) { int x_axis= 50; int y_axis = 80; Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); XMLReading xmlreadingObj = new XMLReading(); try { xmlreadingObj.fileParsing("C:/Documents and Settings/8563/TEST/src/Gantt.xml"); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (SAXException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } it = xmlreadingObj.getres_list().iterator(); it_wrk_drawing = xmlreadingObj.getrev__wrkOrder_list().iterator(); it_frmdate = xmlreadingObj.getrev_frmdate_list().iterator(); it_todate = xmlreadingObj.getrev_todate_list().iterator(); int size = xmlreadingObj.getres_list().size(); g2.setPaint(new Color(0, 128, 192)); int y_rect = 72; int tree_rect_width = 13; int tree_rect_height = 10; int panel_line_x = 300; for (int len=0;len<size;len++) { while(it.hasNext()) { Font font_resourcetrees = new Font("Ariel",Font.PLAIN,9); g2.setFont(font_resourcetrees); g2.fillRect(30,y_rect,tree_rect_width,tree_rect_height); g2.drawLine(panel_line_x,y_axis+14,getWidth(),y_axis+14); g2.drawString(""+it.next(),x_axis,y_axis); /*line for seperating the resource*/ y_axis += 28; y_rect += 28; } } } /*This method is for drawing the calender in the right top of the panel*/ public Date drawCalendar( Graphics g) { Graphics2D g2 = (Graphics2D)g; int no_ofday = this.no_of_days; long from; long to; int n = 168; int x = 300; int x1_cal = 300; int x3 = x; int width1 = 180; int daydx = (width1 / 2); int dayx = (daydx + x); int f2 = x + n; String date[] = {"0", "4", "8", "12", "16", "20", "24"}; int total_no_days = date_difference(g2); long days =(long) total_no_days; no_ofday = (int) days ; Date [] arraydate = drawwrk(g2); g2.setPaint(Color.BLACK); Calendar c = Calendar.getInstance(); // current date* Calendar c1 = Calendar.getInstance(); Date local_fromDate = arraydate[0]; Date toDate = arraydate[arraydate.length-1]; c.setTime(local_fromDate); for (int i = 0; i < no_ofday; i++) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd"); SimpleDateFormat sdf1 = new SimpleDateFormat("EEE"); // use the pattern: day_of_month String str = sdf.format(c.getTime()); // fromat the date to string String str3 = sdf1.format(c1.getTime()); for (int j = 0; j < 6; j++) { Font font1 = new Font("Ariel", Font.PLAIN, 9); g2.setFont(font1); g2.drawLine(x1_cal, 50, x1_cal, 55); g2.drawString(date[j], x1_cal, 45); x1_cal += 30; } g2.drawRect(x, 10, width1, 45); g2.drawString("24", f2, 45); f2 += width1; x += width1; g2.drawString(str, dayx-10, 35); g2.drawString(str3,dayx-5,20); dayx += 180; int nextdate = c.get(Calendar.DATE) + 1; c.set(Calendar.DATE, nextdate); int nextdate1 = c1.get(Calendar.DAY_OF_WEEK)+1; c1.set(Calendar.DAY_OF_WEEK,nextdate1); } return local_fromDate; } /*This method make the datas in the list in a order. It computes the date and time from the list.. And it return the start date and end date & this was used in calender method*/ public Date [] drawwrk(Graphics g) { Graphics2D g2 = (Graphics2D)g; XMLReading xmlreadingObj = new XMLReading(); try { xmlreadingObj.fileParsing("C:/Documents and Settings/8563/TEST/src/Gantt.xml"); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (SAXException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } res_mseg = xmlreadingObj.res_list; Object [] array = res_mseg.toArray(); rev_list = xmlreadingObj.rev__wrkOrder_list; Object [] array1 = rev_list.toArray(); String str1 = new String(); String str2 = new String(); wrk = xmlreadingObj.wrkorder_list; frm_list = xmlreadingObj.rev_frmdate_list; todate_list = xmlreadingObj.rev_todate_list; fromtime_list = xmlreadingObj.rev_frmtime_list; totime_list = xmlreadingObj.rev_totime_list; Date frmdate = new Date(); Date todate = new Date(); Date frm_time = null; Date to_time = null; Time frmTime = null; Time toTime = null; Date startdate= null; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf_time = new SimpleDateFormat("HH:mm:ss"); int delay =(1000*60*60*24); Calendar c2 = Calendar.getInstance(); Calendar c3 = Calendar.getInstance(); int ftime = 0; int ttime = 0; int dif = 0; int x_1 = 0; int fromdate =0; int to_date =0; int size = res_mseg.size(); int size1 = rev_list.size(); ArrayList res_list = new ArrayList(); String strtdate = frm_list.get(0).toString(); String [] str_array = new String[size]; String [] str1_array = new String[size1]; double x_time; double y_time; double x1 ; double x2; int y_1 =80; int y_axis = 74; int x_cord = this.rect_x; int width = this.rect_w; str_frmdate = new ArrayList<Date>(); for(int len = 0; len < array.length; len++) { int i =0; int j =0; str1 = array[len].toString(); str_array [i] = str1; res_list.add(str1); for(int len1 = 0; len1 < array1.length; len1++) { str2 = array1[len1].toString(); str1_array [j] = str2; if(str1.compareToIgnoreCase(str2) == 0 ) { resno_list.add(str2); str_wrk.add(wrk.get(len1)); String str_date = frm_list.get(len1).toString(); String date_todate = todate_list.get(len1).toString(); String totime = totime_list.get(len1).toString(); String frmtime = fromtime_list.get(len1).toString(); try { frmdate = sdf.parse(str_date); todate = sdf.parse(date_todate); frm_time = sdf_time.parse(frmtime); to_time = sdf_time.parse(totime); } catch (ParseException ex) { ex.printStackTrace(); } c2.setTime(frm_time); c3.setTime(to_time); ftime = c2.get(Calendar.HOUR_OF_DAY); ttime = c3.get(Calendar.HOUR_OF_DAY); int time_diff = ttime - ftime; fromdate = Math.round((frmdate.getTime())/delay); to_date = Math.round((todate.getTime())/delay); str_frmtime.add(frm_time); str_totime.add(to_time); str_frmdate.add(frmdate); str_todate.add(todate); long datediff =((( todate.getTime())/delay)-((difference().getTime())/delay)); long convr_datediff =(datediff*180)+300; /*calculating x-co_ordinate*/ double hour = ftime*7.5; double x_hr = hour +convr_datediff; int conversion = (int)Math.round(x_hr); x_cord = conversion; /*calculating width*/ double x_2 = ttime *7.5; double timediff = x_2 - hour; int width_hr =(int) Math.round(timediff); width =width_hr; //int width =width_hr; try { x_cord_list.add(x_cord); y_cord_list.add(y_axis); width_list.add(width); rectangles.add(new Rectangle(x_cord,y_axis,width,15)); } catch(Exception e2) { System.out.print("EXCEPTION"); } } } y_axis += 28; } Date [] sorted_frmDate = (Date [])str_frmdate.toArray(new Date[str_frmdate.size()]); Date [] sorted_toDate = (Date [])str_todate.toArray(new Date[str_todate.size()]); java.util.Arrays.sort(sorted_frmDate); java.util.Arrays.sort(sorted_toDate); startdate = sorted_frmDate[0]; Date enddate = sorted_toDate[sorted_toDate.length-1]; return new Date [] {startdate,enddate}; } public int date_difference(Graphics g) { int noofdays= this.no_of_days; Date [] date = null; Graphics2D g2 = (Graphics2D)g; long difference = 0; try { date = drawwrk(g2); } catch(NullPointerException nullptr_e) { } Date startDate = date[0]; Date endDate = date[date.length-1]; Calendar c = Calendar.getInstance(); Calendar c1 = Calendar.getInstance(); c.setTime(startDate); c1.setTime(endDate); difference = (c1.getTime().getTime() - c.getTime().getTime()); long total_no_days = Math.round((difference)/(1000*60*60*24)); no_of_days = (int)total_no_days+1; return this.no_of_days; } public Date difference() { Date dt = str_frmdate.get(0); return dt; } public ArrayList getfrmDate() { return str_frmdate; } public void mouseClicked(MouseEvent e) { } public void mousePressed(MouseEvent e) { Point p = e.getPoint(); for(int j = 0; j < rects.length; j++) { if(rects[j].contains(p)) { selectedRect = rects[j]; offset.x = p.x - rects[j].x; offset.y = p.y - rects[j].y; dragging = true; break; } } } public void mouseReleased(MouseEvent e) { rectangles.clear(); dragging = false; } public void mouseEntered(MouseEvent e) {} public void mouseExited(MouseEvent e) {} public void mouseDragged(MouseEvent e) { Point me_p = e.getPoint(); if(dragging == true) { for(int x = 0, y = rects.length; x < y; x++) { selectedRect.setLocation(me_p.x - offset.x,me_p.y - offset.y); this.repaint(); } } } public void actionPerformed(MouseEvent e) {} public void mouseMoved(MouseEvent e) {} } }
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 03-14-2008, 07:09 AM
Member
 
Join Date: Jan 2008
Posts: 81
Preethi is on a distinguished road
Code:
<I resno="102" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-10" wo_end_date="2008-01-10" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="102" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-11" wo_end_date="2008-01-11" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="102" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-14" wo_end_date="2008-01-14" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="102" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-15" wo_end_date="2008-01-15" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="102" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-16" wo_end_date="2008-01-16" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="102" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-17" wo_end_date="2008-01-17" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="102" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-18" wo_end_date="2008-01-18" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="102" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-21" wo_end_date="2008-01-21" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="103" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-22" wo_end_date="2008-01-22" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="103" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-23" wo_end_date="2008-01-23" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="103" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-24" wo_end_date="2008-01-24" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="103" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-25" wo_end_date="2008-01-25" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="103" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk="1" capplgtype="1" item_code="CVC022" sdesc3="" sdesc4="" flag="D" reqddate="Jan 1 2000" schdate="Jan 1 2000 12:00AM" wo_start_date="2008-01-28" wo_end_date="2008-01-28" fromdate="09:00:00" todate="18:00:00" regen="N" /> <I resno="103" capcheck="D" rescapacity="1.00000000" time_buffer="219170989" timeindays1="1" avlqty="0" work_order_no="WO-W/000409/06" rsscheduleno="10" lineno="1" status="D" subactivity_code_mul="1" activitytimetype="0" actrep="1" chkflag="1" execute_online="1" io_flag_dp="1" mplannerchk=&quo