Permalink
Browse files

Final tweaks

  • Loading branch information...
1 parent 707822b commit b7fa1c534f225631a108f45836849c306d130f91 @kylecordes committed Oct 20, 2008
Showing with 28 additions and 117 deletions.
  1. +14 −7 js/flying.js
  2. +4 −5 js/login.js
  3. +10 −86 misc/index.html
  4. +0 −19 misc/todo.txt
View
@@ -50,6 +50,8 @@ function createWorkOrderPanel(_workOrder) {
function Slots(_layeredPane) {
var layeredPane = _layeredPane;
var points = [];
+
+ // I wrote these as consts in Java, no const in JS.
var LEFT_MARGIN = 30;
var TOP_MARGIN = 3;
var RIGHT_MARGIN = 3;
@@ -146,6 +148,11 @@ Array.prototype.insert = function( i, v ) {
}
function _OrderingWidget() {
+
+ // var is good enough for private variables only
+ // accessed by functions in this block. Use "this." for publics
+ // or other variables you need to access outside this block.
+
var panels = [];
var dragging;
var grabXoffset;
@@ -156,7 +163,7 @@ function _OrderingWidget() {
var moveTimer;
scrollPane.setBorder(BorderFactory.createEmptyBorder());
- scrollPane.setPreferredSize(new Dimension(500, 400));
+ scrollPane.setPreferredSize(new Dimension(800, 500));
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
@@ -168,21 +175,19 @@ function _OrderingWidget() {
}
});
- moveTimer = new javax.swing.Timer(25, function() {
+ moveTimer = new javax.swing.Timer(20, function() {
parent.driftPositions();
});
// **************** Mouse Event Handlers ******************
this.setupHandlers = function() {
+ // This must be called after my prototype is set by the JavaAdapter constructor,
+ // so that parent methods like addMouseListener are found.
layeredPane.addMouseListener(this);
layeredPane.addMouseMotionListener(this);
}
- //public void mouseEntered(MouseEvent e) {
- //public void mouseExited(MouseEvent e) {
- //public void mouseMoved(MouseEvent e) {
-
this.mousePressed = function(e) {
var c = layeredPane.getComponentAt(e.getPoint());
if (c instanceof JPanel) {
@@ -258,7 +263,7 @@ function _OrderingWidget() {
function closerCoord(current, target) {
var gap = Math.abs(target - current);
- var increment = Math.ceil(0.1 * gap);
+ var increment = Math.ceil(0.12 * gap);
if (current > target) {
return current - increment;
} else {
@@ -297,6 +302,8 @@ function _OrderingWidget() {
}
function createOrderingWidget() {
+ // This is the way I found to subclass a Java class. It is ugly, but works.
+ // Rhino gurus probably have a better way.
var ow = new JavaAdapter(MouseListener, MouseMotionListener, new _OrderingWidget());
ow.setupHandlers();
return ow;
View
@@ -30,18 +30,17 @@ function login() {
layeredPane.setBorder(BorderFactory.createEmptyBorder());
function createImageIcon(path) {
- var someClass = new Frame();
- someClass = someClass.getClass();
- var imgURL = someClass.getResource(path);
+ var loader = java.lang.Thread.currentThread().getContextClassLoader();
+ var imgURL = loader.getResource(path);
if (imgURL != null) {
return new ImageIcon(imgURL);
} else {
intf.print("Couldn't find file: " + path);
- return null;
+ return new ImageIcon();
}
}
- var image = createImageIcon("/logo.jpg");
+ var image = createImageIcon("logo.jpg");
var picture = new JLabel(image);
picture.setBounds(0, 0, picWidth, 260);
layeredPane.add(picture);
View
@@ -1,53 +1,6 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
+<html>
<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 11">
-<meta name=Originator content="Microsoft Word 11">
-<link rel=File-List href="index_files/filelist.xml">
<title>Kyle Cordes's Rhino Swing Test App</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Author>Kyle Cordes</o:Author>
- <o:LastAuthor>Kyle Cordes</o:LastAuthor>
- <o:Revision>9</o:Revision>
- <o:TotalTime>5</o:TotalTime>
- <o:Created>2008-07-20T14:41:00Z</o:Created>
- <o:LastSaved>2008-07-20T15:03:00Z</o:LastSaved>
- <o:Pages>1</o:Pages>
- <o:Words>45</o:Words>
- <o:Characters>258</o:Characters>
- <o:Company>Oasis Digital Solutions Inc.</o:Company>
- <o:Lines>2</o:Lines>
- <o:Paragraphs>1</o:Paragraphs>
- <o:CharactersWithSpaces>302</o:CharactersWithSpaces>
- <o:Version>11.9999</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:SpellingState>Clean</w:SpellingState>
- <w:GrammarState>Clean</w:GrammarState>
- <w:PunctuationKerning/>
- <w:ValidateAgainstSchemas/>
- <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
- <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
- <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
- <w:Compatibility>
- <w:BreakWrappedTables/>
- <w:SnapToGridInCell/>
- <w:WrapTextWithPunct/>
- <w:UseAsianBreakRules/>
- <w:DontGrowAutofit/>
- </w:Compatibility>
- <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
- </w:WordDocument>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
- </w:LatentStyles>
-</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@@ -91,26 +44,6 @@
{page:Section1;}
-->
</style>
-<!--[if gte mso 10]>
-<style>
- /* Style Definitions */
- table.MsoNormalTable
- {mso-style-name:"Table Normal";
- mso-tstyle-rowband-size:0;
- mso-tstyle-colband-size:0;
- mso-style-noshow:yes;
- mso-style-parent:"";
- mso-padding-alt:0in 5.4pt 0in 5.4pt;
- mso-para-margin:0in;
- mso-para-margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:10.0pt;
- font-family:"Times New Roman";
- mso-ansi-language:#0400;
- mso-fareast-language:#0400;
- mso-bidi-language:#0400;}
-</style>
-<![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple style='tab-interval:.5in'>
@@ -121,8 +54,7 @@
style='font-size:16.0pt;font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal align=center style='text-align:center'><span
-style='font-size:16.0pt;font-family:Georgia'>Kyle <span class=SpellE>Cordes's</span>
-Rhino Swing Test App<o:p></o:p></span></p>
+style='font-size:16.0pt;font-family:Georgia'>Kyle Cordes's Rhino Swing Test App<o:p></o:p></span></p>
<p class=MsoNormal align=center style='text-align:center'><span
style='font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
@@ -134,31 +66,23 @@
style='font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal align=center style='text-align:center'><span
-style='font-family:Georgia'>Launch: <a href="rsta.jnlp"><span class=SpellE>rsta.jnlp</span></a><o:p></o:p></span></p>
+ style='font-family:Georgia'>Launch: <a href="rsta.jnlp"><span class=SpellE>rsta.jnlp</span></a><o:p></o:p></span></p>
-<p class=MsoNormal align=center style='text-align:center'><span
-style='font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
+<p class=MsoNormal align=center style='text-align:center'><span style='font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
-<p class=MsoNormal align=center style='text-align:center'><span
-style='font-size:10.0pt;font-family:Georgia'>(Signed with a test key; you'll<o:p></o:p></span></p>
+<p class=MsoNormal align=center style='text-align:center'><span style='font-size:10.0pt;font-family:Georgia'>Log in with any user/pw, click "Lets do it".<o:p></o:p></span></p>
+<p class=MsoNormal align=center style='text-align:center'><span style='font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
-<p class=MsoNormal align=center style='text-align:center'><span class=GramE><span
-style='font-size:10.0pt;font-family:Georgia'>get</span></span><span
-style='font-size:10.0pt;font-family:Georgia'> a warning from Web Start.)<o:p></o:p></span></p>
+<p class=MsoNormal align=center style='text-align:center'><span style='font-size:10.0pt;font-family:Georgia'>(Signed with a test key; you'll<o:p></o:p></span></p>
-<p class=MsoNormal align=center style='text-align:center'><span
-style='font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
+<p class=MsoNormal align=center style='text-align:center'><span style='font-size:10.0pt;font-family:Georgia'>get a warning from Web Start.)<o:p></o:p></span></p>
+
+<p class=MsoNormal align=center style='text-align:center'><span style='font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal align=center style='text-align:center'><span
style='font-family:Georgia'>Code: <a href="http://github.com/kylecordes/rsta/"><span
class=SpellE>github.com/kylecordes/rsta</span>/</a><o:p></o:p></span></p>
-<p class=MsoNormal align=center style='text-align:center'><span
-style='font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
-
-<p class=MsoNormal align=center style='text-align:center'><span
-style='font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
-
<p class=MsoNormal><span style='font-family:Georgia'><o:p>&nbsp;</o:p></span></p>
</div>
View
@@ -1,19 +0,0 @@
-
-Ant build produces working .bat runner
-Ant build produces working JWS files
-Revamp the Java file to expunge all past licensed data
-Remove superflopus JS
-
-
-Splash screen
-menu bar
-Toolbar
-Images on toolbar
-
-
-try the drag-and-drop demo screen in JS
-
-reload while running
-
-
-

0 comments on commit b7fa1c5

Please sign in to comment.