[subversion:7] Prior to Version 0.15.

  • From: sherod@kenai.com
  • To: commits@twitterfx.kenai.com
  • Subject: [subversion:7] Prior to Version 0.15.
  • Date: Mon, 5 Jan 2009 18:47:23 +0000 (GMT)

Repository: subversion
Revision:   7
Author:     sherod
Date:       2009-01-05 18:47:20 UTC

Log Message:
-----------
Prior to Version 0.15.

Added network error messages and error handling, moved the URLEntry
Dialog,  added opacity to the tweetnodes (So you can see through them
to your background image), tweeked the background image to scale with
the app.   Fixed the tooltip size.

Modified Paths:
--------------
    twitterfx/src/twitterfx/Main.fx
    twitterfx/src/twitterfx/components/DirectNode.fx
    twitterfx/src/twitterfx/components/TinyButton.fx
    twitterfx/src/twitterfx/components/ToolBox.fx
    twitterfx/src/twitterfx/components/ToolTip.fx
    twitterfx/src/twitterfx/components/TweetNode.fx
    twitterfx/src/twitterfx/components/TweetTextComponent.fx
    twitterfx/src/twitterfx/components/URLEntryDialog.fx
    twitterfx/src/twitterfx/panels/SendTweetPanel.fx
    twitterfx/src/twitterfx/twitter/RequestHandler.fx
    twitterfx/src/twitterfx/twitter/UpdateRequestHandler.fx

Added Paths:
-----------
    twitterfx/src/twitterfx/components/NetworkErrorMessage.fx

Diffs:
-----
Index: twitterfx/src/twitterfx/Main.fx
===================================================================
--- twitterfx/src/twitterfx/Main.fx     (revision 6)
+++ twitterfx/src/twitterfx/Main.fx     (revision 7)
@@ -45,6 +45,7 @@
 import javax.swing.UIManager;
 import scrollpanel.ScrollPanel;
 import twitterfx.browser.BareBonesBrowserLaunch;
+import twitterfx.components.NetworkErrorMessage;
 import twitterfx.components.TextButton;
 import twitterfx.components.ToolTip;
 import twitterfx.Main;
@@ -68,6 +69,7 @@
     println(currentWidth);
 }
 public var isErrorPending:Boolean;
+public var networkErrorText:String;
 public var mouseX:Number;
 public var mouseY:Number;
 public var label:String;
@@ -89,7 +91,7 @@
                 timeNow = (
                 new Date()).getTime();
 
-            } }
+        } }
     ]
 }
 
@@ -101,7 +103,7 @@
             time: 3m
             action: function() {
                 visiblePanel.remoteCall();
-            } }
+        } }
     ]
 }
 
@@ -117,7 +119,7 @@
 
         image = Image {
             url: imageUrl
-            backgroundLoading: true
+          //  backgroundLoading: true
         }
     }
     cacheList.put(imageUrl, image);
@@ -181,6 +183,7 @@
     sendTweetText = "";
 }
 
+
 public var visiblePanel:ScrollPanel;
 
 public var connectionStatus:String;
@@ -284,7 +287,7 @@
             opacity: 0.9
             fill: Color.web("#2B2B2B")
             width: bind (mainScene.width - 20)
-            height: 450 },
+        height: 450 },
         ImageView {
             translateX: bind mainScene.width - 180
             translateY: 20
@@ -311,12 +314,12 @@
                         size: 13
                     }
                     fill: Color.WHITE
-                    content: "Screenname"},
+                content: "Screenname"},
                 Text {
                     textOrigin: TextOrigin.TOP
                     translateX: 5
                     fill: Color.WHITE
-                    content: bind currentUser.screenName  },
+                content: bind currentUser.screenName  },
                 Text {
                     textOrigin: TextOrigin.TOP
                     font: Font {
@@ -324,12 +327,12 @@
                         size: 13
                     }
                     fill: Color.WHITE
-                    content: "Fullname"},
+                content: "Fullname"},
                 Text {
                     textOrigin: TextOrigin.TOP
                     translateX: 5
                     fill: Color.WHITE
-                    content: bind currentUser.name },
+                content: bind currentUser.name },
                 Text {
                     textOrigin: TextOrigin.TOP
                     font: Font {
@@ -337,13 +340,13 @@
                         size: 13
                     }
                     fill: Color.WHITE
-                    content: "Description"},
+                content: "Description"},
                 Text {
                     textOrigin: TextOrigin.TOP
                     translateX: 5
                     fill: Color.WHITE
                     wrappingWidth:260
-                    content: bind currentUser.description },
+                content: bind currentUser.description },
                 Text {
                     textOrigin: TextOrigin.TOP
                     font: Font {
@@ -351,12 +354,12 @@
                         size: 13
                     }
                     fill: Color.WHITE
-                    content: "Follower Count / Friend Count"},
+                content: "Follower Count / Friend Count"},
                 Text {
                     textOrigin: TextOrigin.TOP
                     translateX: 5
                     fill: Color.WHITE
-                    content: bind
"{java.lang.Integer.toString(currentUser.followerCount)}
{java.lang.Integer.toString(currentUser.friendsCount)}"  },
+                content: bind
"{java.lang.Integer.toString(currentUser.followerCount)}
{java.lang.Integer.toString(currentUser.friendsCount)}"  },
                 Text {
                     textOrigin: TextOrigin.TOP
                     font: Font {
@@ -364,7 +367,7 @@
                         size: 13
                     }
                     fill: Color.WHITE
-                    content: "Website"},
+                content: "Website"},
                 Group {
                     content: [ Rectangle {
                             width: 300
@@ -378,7 +381,7 @@
                     cursor: Cursor.HAND
                     onMousePressed: function( e: MouseEvent ):Void {
                        
BareBonesBrowserLaunch.openURL(currentUser.url);
-                } },
+                    } },
                 TextButton {
                     opacity: bind
                         if (currentUser.isFollowing) 0.4 else 1
@@ -386,14 +389,14 @@
                     action: function() {
                         TwitterAPI.follow(currentUser.id)
 
-                }},TextButton {
+                    }},TextButton {
                     opacity: bind
                         if (currentUser.isFollowing) 1 else 0.4
                     text: "Unfollow"
                     action: function() {
                         TwitterAPI.unfollow(currentUser.id)
 
-                }},
+                    }},
                 TextButton {
                     opacity: bind
                         if (currentUser.isFollowing) 0.4 else 1
@@ -401,19 +404,19 @@
                     action: function() {
                         TwitterAPI.follow(currentUser.id)
 
-                }},TextButton {
+                    }},TextButton {
                     opacity: bind
                         if (currentUser.isFollowing) 1 else 0.4
                     text: "Unblock"
                     action: function() {
                         TwitterAPI.unfollow(currentUser.id)
 
-                }},TextButton {
+                    }},TextButton {
                     text: "Direct Message"
                     action: function() {
                         Main.sendTweetText = "d
{currentUser.screenName}"
 
-                }},
+                    }},
 
 
                 TextButton {
@@ -422,13 +425,14 @@
                         Main.showCurrentUser(false)
 
                     }
-                } ] } ]
+        } ] } ]
 
         }
 
 public function showCurrentUser(showUser:Boolean):
 Void{
-    TwitterAPI.userDetail(currentUser.id);
+    if (showUser)
+        TwitterAPI.userDetail(currentUser.id);
     currentUserPanel.visible = showUser;
 }
 
@@ -441,21 +445,21 @@
 }
 
 
-var sendTweetPanel:SendTweetPanel = SendTweetPanel {
+public var sendTweetPanel:SendTweetPanel = SendTweetPanel {
 
-    translateY: bind (mainScene.height - 120)
+    translateY: bind (mainScene.height - 25)
     
 }
 
 var backgroundImageView = ImageView {
     id: "twifxerImage"
-    fitHeight: 650
+    fitWidth: bind mainScene.width
     preserveRatio: true
     image: bind twitterConfig.backgroundImage
-     onMouseWheelMoved: function( e: MouseEvent ):Void {
-            visiblePanel.onMouseWheelMoved(e);
-        }
+    onMouseWheelMoved: function( e: MouseEvent ):Void {
+        visiblePanel.onMouseWheelMoved(e);
     }
+    }
 
 var topControlPanel:TopControlPanel = TopControlPanel {
 
@@ -485,6 +489,12 @@
 var stageX = 200.0;
 var stageY = 200.0;
 
+var networkErrorPanel:NetworkErrorMessage = NetworkErrorMessage {
+    whoFrom: "Twitter says:"
+    message: bind networkErrorText;
+    visible: bind isErrorPending
+}
+
 var  mainScene:Scene = Scene {
 
     fill: Color.web("#232323")
@@ -540,7 +550,7 @@
         backgroundImageView, 
         VBox {
             content: [ Group {
-        content: [ friendTimelinePanel, repliesTimelinePanel,
directTimelinePanel, favesTimelinePanel, publicTimelinePanel ,
followersPanel, friendPanel ,settingsPanel] }] }, topControlPanel,
sendTweetPanel, currentUserPanel, toolTip]
+                    content: [ friendTimelinePanel,
repliesTimelinePanel, directTimelinePanel, favesTimelinePanel,
publicTimelinePanel , followersPanel, friendPanel ,settingsPanel] }] },
topControlPanel, sendTweetPanel, currentUserPanel, toolTip,
networkErrorPanel]
     }
 
 
Index: twitterfx/src/twitterfx/panels/SendTweetPanel.fx
===================================================================
--- twitterfx/src/twitterfx/panels/SendTweetPanel.fx    (revision 6)
+++ twitterfx/src/twitterfx/panels/SendTweetPanel.fx    (revision 7)
@@ -51,24 +51,25 @@
 import twitterfx.twitpic.TwitPicAsync;
 import twitterfx.twitpic.TwitPicData;
 import twitterfx.twitter.TwitterAPI;
+import javafx.scene.input.MouseEvent;
 
-/**
- * @author steven
- */
-class OpenFileFilter extends javax.swing.filechooser.FileFilter {
-    override public function getDescription() : String {
+    /**
+    * @author steven
+     */
+    class OpenFileFilter extends javax.swing.filechooser.FileFilter {
+        override public function getDescription() : String {
         return "JPG and PNG images";
-    }
+        }
 
-    override public function accept(f: java.io.File) : Boolean {
-        return f.isDirectory()
+        override public function accept(f: java.io.File) : Boolean {
+            return f.isDirectory()
             or f.getName().endsWith(".png")
         or f.getName().endsWith(".jpg");
+        }
     }
-}
 
 public class SendTweetPanel extends CustomNode {
-
+    var isRevealed:Boolean;
     var animationY:Number;
     
     var timeline:Timeline =  Timeline {
@@ -79,13 +80,15 @@
             animationY => 0.0 tween Interpolator.LINEAR;
                     },
                     at (0.25s) {
-            animationY => 95.0 tween Interpolator.LINEAR;
+            animationY => -95.0 tween Interpolator.LINEAR;
                     }
         ]
             }
        
     var urlEntryDialog: URLEntryDialog =  URLEntryDialog{
-        visible:false};
+        translateY: -50;
+        visible: false;
+    };
 
     var fileChooser:JFileChooser;
 
@@ -106,6 +109,7 @@
     public var tweetBox:TweetTextComponent = TweetTextComponent{
         translateY: 5;
         text: bind Main.sendTweetText with inverse;
+        width: bind (scene.width - 100)
     };
 
    
@@ -133,7 +137,7 @@
                 translateX:10
                 width: bind (scene.width - 40)
                 height: 70
-                 fill: LinearGradient {
+                fill: LinearGradient {
                     startX: 0.0,
                     startY: 0.0,
                     endX: 0.0,
@@ -156,6 +160,7 @@
                 translateY: 5
                 content: [
                     TinyButton {
+                        blocksMouse:false
                         fill: Color.WHITE
                         icon: "grey/Link"
                         label: "Insert link using TinyURL"
@@ -167,6 +172,7 @@
                         }
                     },
                     TinyButton {
+                        blocksMouse:false
                         fill: Color.WHITE
                         icon: "grey/Photo"
                         label: "Upload picture via TwitPic"
@@ -186,8 +192,8 @@
                                 twitpicData: new TwitPicData("sherod",
"golfme", 
                                     new File(bgUrl));
                                 onComplete: function(tpd:TwitPicData){
-                                    tweetBox.text +=
-                                    tpd.getURL();
+                                    showTweetPanel();
+                                    tweetBox.addSuffix(tpd.getURL());
                                 }
                             }
                         }
@@ -202,9 +208,35 @@
 
     }
 
-   
+    public function showTweetPanel():Void{
+        if (not isRevealed)
+        {
+            timeline.rate =  1.0;
+            timeline.play();
+        }
+        tweetBox.requestFocus();
+        isRevealed = true;
+    }
 
+    public function hideTweetPanel():Void{
+        if (isRevealed)
+        {
+            timeline.rate =  -1.0;
+            timeline.play();
+        }
+        isRevealed = false;
+    }
 
+    public function toggleTweetPanel():Void{
+        timeline.rate = timeline.rate * - 1.0;
+        timeline.play();
+        isRevealed = not isRevealed;
+        if (isRevealed)
+            tweetBox.requestFocus();
+    }
+
+
+
     var minimizePanel: Group =
     HBox {
         translateX: 5
@@ -216,8 +248,7 @@
                 label: "Reveal the tweet entry box"
                 action: function() {
 
-                    timeline.rate = timeline.rate * - 1.0;
-                    timeline.play();
+                    toggleTweetPanel();
                     
                 }
                  } ]
Index: twitterfx/src/twitterfx/twitter/RequestHandler.fx
===================================================================
--- twitterfx/src/twitterfx/twitter/RequestHandler.fx   (revision 6)
+++ twitterfx/src/twitterfx/twitter/RequestHandler.fx   (revision 7)
@@ -23,12 +23,12 @@
 import java.io.InputStream;
 import javafx.io.http.HttpHeaders;
 import javafx.io.http.HttpRequest;
+import twitterfx.Main;
 import twitterfx.twitter.Base64;
-import twitterfx.panels.StatusPanel;
 import java.lang.Exception;
-import twitterfx.Main;
+import java.io.IOException;
+import java.net.UnknownHostException;
 
-
 public class RequestHandler extends HttpRequest {
 
     init {
@@ -40,16 +40,46 @@
 
     public override var onException = function(exception: Exception) {
         exception.printStackTrace();
-       // Main.resetRestaurantDetails();
-        var message = exception.getMessage();
-        if(message == null) { message = exception.toString(); }
-        //Main.alert("Error:", message.trim());
+        Main.isErrorPending = true;
+        var message = exception.toString();
+        if (exception instanceof java.net.SocketException) {
+                message = "Could not reach twitter.com, is your
Internet connection okay?"
+        }  else if (exception instanceof
java.net.UnknownHostException) {
+                message = "Could not find twitter.com, is your
Internet connection okay?"
+        } else if (exception instanceof java.io.IOException) {
+            if (message.indexOf("400") > -1)
+               message = "You've exceeded the number of requests
allowed in an hour, try again later"
+            else if (message.indexOf("401") > -1)
+                message = "Invalid Password, check your credentials"
+           else if (message.indexOf("404") > -1)
+                message = "A 404 response from Twitter?, something is
very wrong with TwitterFX"
+           else if (message.indexOf("500") > -1)
+                message = "500! Twitter is very sick, try again later"
+           else if (message.indexOf("502") > -1)
+                message = "502! Twitter is undergoing maintenance, try
again later"
+           else if (message.indexOf("503") > -1)
+                message = "503! Twitter to busy to respond, try again
later"
+           else
+                message = "TwitterFX says something is wrong, but
didn't explain what..."
+        } else  {
+            if(message == null) { message = exception.toString(); }
+        }
+         
+       Main.networkErrorText = message;
+
     }
 
+    /*
+ *      This is fantastic, JavaFX calles the onException handler
because of the non 200 responses, but won't call the onResponseCode
function detail with it
+ *      That's why I'm doing 'indexOf' on error messages in the above
'onException' handler
+    */
     public override var onResponseCode =
function(responseCode:Integer) {
-        if (responseCode != 200) {
-           println("Error fetching results: {responseCode}
{responseMessage}");
+        if (responseCode == 200 or responseCode == 304) {
+            Main.isErrorPending = false;
+        } else {
            Main.isErrorPending = true;
+            Main.networkErrorText = "TwitterFX says something is wrong
({responseCode}), but didn't explain what..."
+
         }
     }
 
Index: twitterfx/src/twitterfx/twitter/UpdateRequestHandler.fx
===================================================================
--- twitterfx/src/twitterfx/twitter/UpdateRequestHandler.fx    
(revision 6)
+++ twitterfx/src/twitterfx/twitter/UpdateRequestHandler.fx    
(revision 7)
@@ -42,17 +42,55 @@
     
     public var processResults: function(is: InputStream);
 
-    public override var onException = function(exception: Exception) {
+      public override var onException = function(exception: Exception)
{
         exception.printStackTrace();
-       // Main.resetRestaurantDetails();
-        var message = exception.getMessage();
-        if(message == null) { message = exception.toString(); }
-        //Main.alert("Error:", message.trim());
+        Main.isErrorPending = true;
+        var message = exception.toString();
+        if (exception instanceof java.io.IOException) {
+            if (message.indexOf("400") > -1)
+               message = "You've exceeded the number of requests
allowed in an hour, try again later"
+            else if (message.indexOf("401") > -1)
+                message = "Invalid Password, check your credentials"
+           else if (message.indexOf("404") > -1)
+                message = "A 404 response from Twitter?, something is
very wrong with TwitterFX"
+           else if (message.indexOf("500") > -1)
+                message = "500! Twitter is very sick, try again later"
+           else if (message.indexOf("502") > -1)
+                message = "502! Twitter is undergoing maintenance, try
again later"
+           else if (message.indexOf("503") > -1)
+                message = "503! Twitter to busy to respond, try again
later"
+           else
+                message = "TwitterFX says something is wrong, but
didn't explain what..."
+        } else if (exception instanceof java.net.SocketException) {
+                message = "Could not reach twitter.com, is your
Internet connection okay?"
+        }  else if (exception instanceof
java.net.UnknownHostException) {
+                message = "Could not find twitter.com, is your
Internet connection okay?"
+        } else {
+            if(message == null) { message = exception.toString(); }
+        }
+
+       Main.networkErrorText = message;
+
     }
 
     public override var onResponseCode =
function(responseCode:Integer) {
         if (responseCode != 200) {
            Main.isErrorPending = true;
+
+           if (responseCode == 400)
+                Main.networkErrorText = "You've exceeded the number of
requests allowed in an hour, try again later"
+            else if (responseCode == 401)
+                Main.networkErrorText = "Invalid Password, check your
credentials"
+           else if (responseCode == 404)
+                Main.networkErrorText = "A 404 response from Twitter?,
something is very wrong with TwitterFX"
+           else if (responseCode == 500)
+                Main.networkErrorText = "500! Twitter is very sick,
try again later"
+           else if (responseCode == 502)
+                Main.networkErrorText = "502! Twitter is undergoing
maintenance, try again later"
+           else if (responseCode == 503)
+                Main.networkErrorText = "503! Twitter to busy to
respond, try again later"
+           else
+                Main.networkErrorText = "{responseCode}! TwitterFX
doesn't know what Twitter means by this.."
         }
     }
 
Index: twitterfx/src/twitterfx/components/URLEntryDialog.fx
===================================================================
--- twitterfx/src/twitterfx/components/URLEntryDialog.fx       
(revision 6)
+++ twitterfx/src/twitterfx/components/URLEntryDialog.fx       
(revision 7)
@@ -53,11 +53,11 @@
 
 
     var outerFrame:Rectangle = Rectangle {
-        width: 400  //TODO tweet width
+        width: bind (scene.width - 15) 
         height: 100
         arcHeight: 15
         arcWidth: 15
-        fill: Color.WHITE  //TODO remove the WHITE background
+        fill: Color.web("#3d3d3d")
         }
 
     var urlText:URLTextField = URLTextField {
@@ -72,7 +72,9 @@
                 onDone: function(success:Boolean):Void {
                     if(success) {
                         var response = rtd.document;
-                        Main.sendTweetText += response;
+                        Main.sendTweetPanel.showTweetPanel();
+                       
Main.sendTweetPanel.tweetBox.addSuffix(response);
+
                     }else {
                         System.out.println("failure =
{rtd.failureText}");
                     }
@@ -98,13 +100,12 @@
     override protected function create():Node {
 
         return Group {
-            id: "thisnode"
-            translateY: -200
-            content: [ outerFrame, VBox {
-
+     
+            visible: bind visible
+            translateY: bind translateY
+            content: [outerFrame, VBox {
                     translateY: 20
                     translateX: 10
-                    visible: bind visible;
                     content: [urlText, buttonGroup]
         }] }
 
Index: twitterfx/src/twitterfx/components/NetworkErrorMessage.fx
===================================================================
--- twitterfx/src/twitterfx/components/NetworkErrorMessage.fx  
(revision 0)
+++ twitterfx/src/twitterfx/components/NetworkErrorMessage.fx  
(revision 7)
@@ -0,0 +1,90 @@
+/*
+   TwitterFX  http://herod.net/twitterfx/
+    Copyright (C) 2009 Steven Herod  (steven.herod@gmail.com)
+
+    This program is free software: you can redistribute it and/or
modify
+    it under the terms of the GNU General Public License as published
by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see
<http://www.gnu.org/licenses/>
+*/
+/*
+ * URLEntryDialog.fx
+ *
+ * Created on Dec 16, 2008, 4:00:09 PM
+ */
+
+package twitterfx.components;
+
+import javafx.scene.CustomNode;
+import javafx.scene.Group;
+import javafx.scene.layout.VBox;
+import javafx.scene.Node;
+import javafx.scene.paint.Color;
+import javafx.scene.shape.Rectangle;
+import javafx.scene.text.Text;
+import javafx.scene.transform.Rotate;
+
+
+
+/**
+ * @author steven
+ */
+
+public class NetworkErrorMessage extends CustomNode {
+
+    override var visible;
+    public var message:String;
+    public var whoFrom:String;
+
+    var whoFromText:Text = Text {
+        content: bind whoFrom
+        wrappingWidth: 280
+    }
+
+    var messageText:Text = Text {
+        content: bind message
+        wrappingWidth: 280
+    }
+    
+    var outerFrame:Rectangle = Rectangle {
+        translateY: 10
+        width: 300  //TODO tweet width
+        height: 50
+        arcHeight: 15
+        arcWidth: 15
+        fill: Color.ANTIQUEWHITE
+        }
+
+   var arrow:Rectangle = Rectangle {
+       translateX: 280
+        width: 20  //TODO tweet width
+        height: 20
+        fill: Color.ANTIQUEWHITE
+        transforms: Rotate { angle: 45 }
+        }
+
+
+    override protected function create():Node {
+
+        return Group {
+            visible: bind visible;
+            translateX: bind scene.width - 320
+            translateY: 30
+            content: [ outerFrame, arrow, VBox {
+
+                    translateY: 25
+                    translateX: 10
+                    visible: bind visible;
+                    content: [whoFromText, messageText]
+        }] }
+
+    }
+}
Index: twitterfx/src/twitterfx/components/TinyButton.fx
===================================================================
--- twitterfx/src/twitterfx/components/TinyButton.fx    (revision 6)
+++ twitterfx/src/twitterfx/components/TinyButton.fx    (revision 7)
@@ -42,6 +42,7 @@
 
 public class TinyButton  extends CustomNode {
 
+    override public var blocksMouse = true;
     public var label:String;
     public var action:function():Void;
     public var icon:String;
@@ -52,7 +53,7 @@
 
     override protected function create():Node {
         button = Group {
-            blocksMouse: true;
+            blocksMouse: bind blocksMouse;
             content: [
               
                 ImageView {
Index: twitterfx/src/twitterfx/components/TweetTextComponent.fx
===================================================================
--- twitterfx/src/twitterfx/components/TweetTextComponent.fx   
(revision 6)
+++ twitterfx/src/twitterfx/components/TweetTextComponent.fx   
(revision 7)
@@ -39,12 +39,14 @@
 
 public class TweetTextComponent extends SwingComponent{
 
-    var myComponent: JTextArea;
 
+    override public var width on replace {
+          myComponent.setColumns(width/10);
+    }
     public var length: Integer;
     public var tooLong:Boolean = bind if (length > 140) true else
false;
     public var charsToGo:Integer = bind (140 - length);
-
+    var myComponent: JTextArea;
     public var readText:String;
     public var text: String on replace{
        // myComponent.setText(text);
@@ -58,8 +60,14 @@
 
     public function addPrefix(prefix:String){
         myComponent.setText("{prefix} {myComponent.getText()}");
+        myComponent.requestFocus();
     }
 
+     public function addSuffix(suffix:String){
+        myComponent.setText("{myComponent.getText()} {suffix}");
+        myComponent.requestFocus();
+    }
+
     public override function createJComponent():JComponent{
         translateX = 15;
         translateY = 5;
@@ -88,6 +96,7 @@
                 {
                     TwitterAPI.updateStatus(myComponent.getText());
                     myComponent.setText("");
+                    length = myComponent.getDocument().getLength();
                    
                 }
               // if (text != myComponent.getText())
Index: twitterfx/src/twitterfx/components/DirectNode.fx
===================================================================
--- twitterfx/src/twitterfx/components/DirectNode.fx    (revision 6)
+++ twitterfx/src/twitterfx/components/DirectNode.fx    (revision 7)
@@ -135,7 +135,7 @@
             opacity: bind
             if (direct.isDeleted) 0.3 else 1
             clip: Rectangle {
-                width: 405
+                width: bind (scene.width - 15)
                 height: 65
             }
             content: [
@@ -144,7 +144,7 @@
                     if (focused) then 1 else 0.8
                     height: bind
                     if (tweetText.layoutBounds.height < 60) 60 else
tweetText.layoutBounds.height
-                    width: 395
+                    width: bind (scene.width - 25)
                     arcHeight: 15
                     arcWidth: 15
                     translateX: 5
Index: twitterfx/src/twitterfx/components/ToolBox.fx
===================================================================
--- twitterfx/src/twitterfx/components/ToolBox.fx       (revision 6)
+++ twitterfx/src/twitterfx/components/ToolBox.fx       (revision 7)
@@ -46,6 +46,7 @@
         visible: false
         icon: "grey/Player FastFwd"
         action: function() {
+            Main.sendTweetPanel.showTweetPanel();
             Main.sendTweetText = "retweet: @{status.user.screenName}
{status.text}"
         }
 }
@@ -84,7 +85,8 @@
         label: "Send direct message to this tweeter"
         icon: "grey/Mail"
         action: function() {
-            Main.sendTweetText = "d @{status.user.screenName}"
+            Main.sendTweetPanel.showTweetPanel();
+            Main.sendTweetText = "d {status.user.screenName}"
         }
 }
 
Index: twitterfx/src/twitterfx/components/ToolTip.fx
===================================================================
--- twitterfx/src/twitterfx/components/ToolTip.fx       (revision 6)
+++ twitterfx/src/twitterfx/components/ToolTip.fx       (revision 7)
@@ -45,15 +45,15 @@
             size: 9
         }
         textOrigin: TextOrigin.TOP;
-        x: bind if (Main.mouseX < 300) Main.mouseX + 14 else
Main.mouseX - 104
-        y: bind if (Main.mouseX < 500) Main.mouseY + 14 else
Main.mouseY - 24
+        x: bind if (Main.mouseX < 300) Main.mouseX + 14 else
Main.mouseX - 96
+        y: bind if (Main.mouseY < 500) Main.mouseY + 14 else
Main.mouseY - 24
         fill: Color.web("#2B2B2B")
         content: bind Main.label
     }
 
     var background:Rectangle = Rectangle {
         x: bind if (Main.mouseX < 300) Main.mouseX + 10 else
Main.mouseX  - 100
-        y: bind if (Main.mouseX < 500) Main.mouseY + 10 else
Main.mouseY  - 20
+        y: bind if (Main.mouseY < 500) Main.mouseY + 10 else
Main.mouseY  - 28
         fill: Color.WHITE;
         width: bind text.layoutBounds.width + 4
         height: bind text.layoutBounds.height + 4
Index: twitterfx/src/twitterfx/components/TweetNode.fx
===================================================================
--- twitterfx/src/twitterfx/components/TweetNode.fx     (revision 6)
+++ twitterfx/src/twitterfx/components/TweetNode.fx     (revision 7)
@@ -54,6 +54,14 @@
 
 public class TweetNode extends CustomNode {
 
+    public function hasLink():Boolean
+    {
+            if (status.text.indexOf("http://";) > 0)
+                return true;
+
+            return false;
+    }
+
     public function hazeOut(level:Number)
     {
        tweetText.opacity = level;
@@ -102,7 +110,8 @@
                 action: function() {
                     if (not status.isOwnStatus)
                     {
-                        Main.sendTweetText =
"@{status.user.screenName}"
+                        Main.sendTweetText =
"@{status.user.screenName}";
+                         Main.sendTweetPanel.showTweetPanel();
                     } else {
                         TwitterAPI.destroy(status.id);
                         status.isDeleted = true;
@@ -121,13 +130,13 @@
         translateX: 90
         translateY: 5
         cache: true
-        cursor: Cursor.HAND
+        cursor: bind if (hasLink()) Cursor.HAND else Cursor.DEFAULT
         content: [
             r = Rectangle {
                 fill: Color.WHITE
                 opacity: 0
-                width: 295
-                translateY: 20
+                width: bind (scene.width - 130)
+                translateY: 15
                 height: 40
                 arcHeight: 15
                 arcWidth: 15
@@ -171,12 +180,14 @@
                     }
                 ] } ]
         onMouseEntered: function( e: MouseEvent ):Void {
+           if (hasLink())
             r.opacity = 0.1
 
 
         }
         onMouseExited: function( e: MouseEvent ):Void {
-            r.opacity = 0
+            if (hasLink())
+              r.opacity = 0
         }
         onMousePressed: function( e: MouseEvent ):Void {
             var pattern:Pattern =
Pattern.compile("(?:https?|ftps?)://[\\w/%.-]+");
@@ -223,7 +234,7 @@
             }
             content: [
                 mainRec =  Rectangle {
-                  
+                    opacity: 0.8
                     height: bind
                     if (tweetText.layoutBounds.height < 60) 60 else
tweetText.layoutBounds.height
                     width: bind (scene.width - 25)


[subversion:7] Prior to Version 0.15.

sherod 01/05/2009
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close