Skip to content

Commit

Permalink
- renamed ExtensionLoader -> JTabletExtension
Browse files Browse the repository at this point in the history
- updated javadocs to include it
- various javadoc updates
  • Loading branch information
marcello3d committed Feb 28, 2010
1 parent 2d16a99 commit 42093ac
Show file tree
Hide file tree
Showing 11 changed files with 244 additions and 282 deletions.
6 changes: 3 additions & 3 deletions build.xml
Expand Up @@ -479,7 +479,7 @@
<target name="jars.signed" depends="jtablet.signed,demo.signed,installer.signed">
</target>

<target name="javadocs" depends="init" description="generates javadoc API documentation">
<target name="javadocs" depends="init" description="Generate javadoc API documentation">
<mkdir dir="${docs.api}"/>
<javadoc
destdir="${docs.api}"
Expand All @@ -488,8 +488,8 @@
use="true"
classpathref="jtablet.classpath"
Overview="src/overview.html"
windowtitle="JTablet 2.0 API"
Header="JTablet 2.0 API">
windowtitle="JTablet ${spec.version} API"
Header="JTablet ${spec.version} API">

<packageset dir="${src}" defaultexcludes="yes">
<include name="cello/jtablet/**"/>
Expand Down
13 changes: 4 additions & 9 deletions src-demo/cello/demo/jtablet/DemoApplet.java
Expand Up @@ -20,8 +20,8 @@
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;

import cello.jtablet.installer.ExtensionLoader;
import cello.jtablet.installer.ExtensionLoader.InstallStatus;
import cello.jtablet.installer.JTabletExtension;
import cello.jtablet.installer.JTabletExtension.InstallStatus;

/**
* A simple sketching surface applet
Expand All @@ -34,13 +34,9 @@ public class DemoApplet extends JApplet {
/** Require JTablet version for extension installation status. */
public static final String REQUIRED_VERSION = "1.2.0";

public void init() {
public void init() {
InstallStatus installStatus = JTabletExtension.getInstallStatus(REQUIRED_VERSION);

System.out.println("Installed JTablet version: " + ExtensionLoader.getInstalledVersion());
InstallStatus installStatus = ExtensionLoader.getInstallStatus(REQUIRED_VERSION);

System.out.println("install status = "+installStatus);

Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());

Expand Down Expand Up @@ -132,7 +128,6 @@ public void actionPerformed(ActionEvent e) {

contentPane.add(tabbedPane,BorderLayout.CENTER);
break;
case RESTART_REQUIRED:
case UPDATE_REQUIRED:
contentPane.add(new InstallStatusPanel());
break;
Expand Down
6 changes: 3 additions & 3 deletions src-demo/cello/demo/jtablet/InstallStatusPanel.java
Expand Up @@ -12,7 +12,7 @@

import cello.jtablet.DriverStatus;
import cello.jtablet.TabletManager;
import cello.jtablet.installer.ExtensionLoader;
import cello.jtablet.installer.JTabletExtension;

/**
* Displays information about the current JTablet installation.
Expand Down Expand Up @@ -65,8 +65,8 @@ public InstallStatusPanel() {
gbc.gridy++;
}

installVersion.setText(ExtensionLoader.getInstalledVersion());
installStatus.setText(ExtensionLoader.getInstallStatus(DemoApplet.REQUIRED_VERSION).toString());
installVersion.setText(JTabletExtension.getInstalledVersion());
installStatus.setText(JTabletExtension.getInstallStatus(DemoApplet.REQUIRED_VERSION).toString());
DriverStatus status = TabletManager.getDefaultManager().getDriverStatus();
driverStatus.setText(status.getState().toString());
Throwable throwable = status.getThrowable();
Expand Down
17 changes: 0 additions & 17 deletions src-demo/cello/demo/jtablet/TabletListenerLogPanel.java
Expand Up @@ -44,22 +44,5 @@ protected void handleEvent(TabletEvent ev) {
logMessage(ev.toString());
}
});
// targetComponent.addMouseListener(new MouseListener() {
// public void mouseClicked(MouseEvent e) {
// logMessage(e.toString());
// }
// public void mouseEntered(MouseEvent e) {
// logMessage(e.toString());
// }
// public void mouseExited(MouseEvent e) {
// logMessage(e.toString());
// }
// public void mousePressed(MouseEvent e) {
// logMessage(e.toString());
// }
// public void mouseReleased(MouseEvent e) {
// logMessage(e.toString());
// }
// });
}
}
16 changes: 10 additions & 6 deletions src/cello/jtablet/event/TabletEvent.java
Expand Up @@ -136,6 +136,9 @@ public TabletEvent(MouseEvent e, Type type, TabletDevice device) {
* @param e
* @param type
* @param device
* @param c
* @param x
* @param y
*/
public TabletEvent(MouseEvent e, Type type, TabletDevice device, Component c, float x, float y) {
super(c, e.getID(), e.getWhen(), e.getModifiersEx(), (int)x, (int)y, e.getClickCount(), e.isPopupTrigger(), e.getButton());
Expand Down Expand Up @@ -630,34 +633,35 @@ public TabletEvent withType(Type type) {
}

/**
* Returns a copy of this {@linkplain TabletEvent} with the given component and coordinates.
* Constructs a {@linkplain TabletEvent} based on another with a new component and coordinates.
*
* @see #withPoint(float, float)
* @param original
* @param newComponent
* @param newX x-coordinate
* @param newY y-coordinate
* @return a new {@linkplain TabletEvent} with the new component and coordinates
*/
public TabletEvent(TabletEvent original, Component newComponent, float newX, float newY) {
this(newComponent, original.type, original.getWhen(), original.getModifiersEx(),
this(newComponent, original.type, original.getWhen(), original.getModifiersEx(),
original.device, newX, newY, original.pressure,
original.tiltX, original.tiltY, original.sidePressure,
original.rotation,original.scrollX,original.scrollY,original.zoomFactor,
original.getButton(), original.rawTabletButtonMask);
}

/**
* Returns a copy of this {@linkplain TabletEvent} with the given coordinates.
* Constructs a {@linkplain TabletEvent} based on another with new coordinates.
* @param original
* @see #withPoint(Component, float, float)
* @param newX x-coordinate
* @param newY y-coordinate
* @return a new {@linkplain TabletEvent} with the new coordinates
*/
public TabletEvent(TabletEvent original, float newX, float newY) {
this(original, original.getComponent(), newX, newY);
}
/**
* Returns a copy of this {@linkplain TabletEvent} with a new event {@link Type}.
* Constructs a {@linkplain TabletEvent} based on another with a new event {@link Type}.
* @param original
* @param newType the new event type
*/
public TabletEvent(TabletEvent original, Type newType) {
Expand Down
2 changes: 1 addition & 1 deletion src/cello/jtablet/event/package-info.java
Expand Up @@ -22,7 +22,7 @@
*/

/**
* Contains classes for working with tablet events.
* Provides interfaces and classes for dealing with tablet events on AWT components.
*
* @see cello.jtablet.event.TabletListener
*/
Expand Down
239 changes: 0 additions & 239 deletions src/cello/jtablet/installer/ExtensionLoader.java

This file was deleted.

0 comments on commit 42093ac

Please sign in to comment.