- javahostwpf_src.zip
- JavaHostWPF_src
- JavaHostWPF.suo
- JavaHostWPF_DotNET
- JavaHostWPF_Eclipse
- .classpath
- .project
- .settings
- com
- oojni
- javahostwpfdemo.zip
- JavaHostWPF_DotNET
- Demo
- JavaHostWPF.dll
- JavaHostWPF.jar
- oojni.net20.dll
- WPFControls.dll
|
package com.oojni;
import java.awt.Canvas;
/**
* Wraps the main functionality of Calendar Component.
*
* @author Vitaly Shelest
*
*/
public class CalendarContainer extends Canvas {
/**
*
*/
private static final long serialVersionUID = 1L;
static{
System.loadLibrary("oojni.net20");
System.loadLibrary("JavaHostWPF");
}
/**
* Stores a reference to .NET Container
*/
int ref = 0;
protected void finalize() throws Throwable {
super.finalize();
}
/**
* The place to create .NET Container
*/
public void addNotify() {
super.addNotify();
ref = create(this);
}
/**
* Used to dispose .NET Container
*/
public void removeNotify() {
dispose(ref);
super.removeNotify();
}
/**
* Disposes .NET Container
*
*/
public void dispose()
{
if(ref != 0)
dispose(ref);
ref = 0;
}
/**
* Returns Year
*
* @return year value
*/
int getYearFromControl()
{
return getYearFromControl(ref);
}
/**
* Returns Month
*
* @return month value
*/
int getMonthFromControl()
{
return getMonthFromControl(ref);
}
/**
* Returns Day
*
* @return day of the month value
*/
int getDayFromControl()
{
return getDayFromControl(ref);
}
/**
* Sets WPF Clock Component Date/Time
*
* @param _year year value
* @param _month month value
* @param _day day of the month value
* @param _hours hour value
* @param _minutes minutes value
* @param _seconds secons value
*/
void setSystemTime(int _year, int _month, int _day, int _hours, int _minutes, int _seconds)
{
setSystemTime(ref, _year, _month, _day, _hours, _minutes, _seconds);
}
/**
* Returns Year
*
* @param ref .NET Container reference
* @return year value
*/
native int getYearFromControl(int ref);
/**
* Returns Month
*
* @param ref .NET Container reference
* @return month value
*/
native int getMonthFromControl(int ref);
/**
* Returns Month
*
* @param ref .NET Container reference
* @return day of month value
*/
native int getDayFromControl(int ref);
/**
* Sets WPF Component Date/Time
*
* @param ref .NET Container reference
* @param _year year value
* @param _month month value
* @param _day day of month value
* @param _hours hour value
* @param _minutes minutes value
* @param _seconds seconds value
*/
native void setSystemTime(int ref, int _year, int _month, int _day, int _hours, int _minutes, int _seconds);
/**
* Creates .NET Container
* @param parent Java component as a placeholder for .NET Container
* @return reference to .NET Container
*/
native int create(Object parent);
/**
* Disposes .NET Container
* @param ref reference to .NET Container
*/
native void dispose(int ref);
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.