🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1554

Re: displaying child nodes on demand

#1554
From: Alan Shiers
Date: Fri, 31 Oct 2003 17:37
749 lines
31353 bytes
Hi there,

I tried this nodeChanged() method but the root node doesn't display the
child nodes when I expand it.  However, I discovered that if I call
nodeStructureChanged(TreeNode) which is a method in DefaultMutableTreeModel,
it in turn calls fireTreeStructureChanged(...) method.

What I have so far only works when initially getting the child nodes for the
root node when I log onto the server.  The problem comes when I try to
expand one of the root node's children.  I always wind up with the following
error message:

java.lang.ArrayIndexOutOfBoundsException: node has no children
        at
javax.swing.tree.DefaultMutableTreeNode.getChildAt(DefaultMutableTreeNode.ja
va:228)
        at
javax.swing.tree.DefaultTreeModel.getChild(DefaultTreeModel.java:156)
        at
javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeig
htLayoutCache.java:1475)
        at
javax.swing.tree.VariableHeightLayoutCache$TreeStateNode.expand(VariableHeig
htLayoutCache.java:1270)

        ....
        .... etc.


I don't understand how I can give the expanding node its children before the
model tries to access this getChildAt(...) method :(

I thought I was handling it with the if statement in my getChildCount()
method that checks whether or not a particular node in indeed expanding.  If
NodeExpanding is set to true by treeWillExpand( ) method, then the following
if structure should execute, requesting the children's names from the
server.  The server in turn sends an OK message back and starts sending the
names which I collect using my ReceiveChildrenFromServer(...) method.

if(ReceivedChildCount && NodeExpanding)
{
      NodeExpanding = false; //reset
      RequestChildrenFromServer(ParentsWholePath);
      //Set up TreeDataTimer so that we know we have a
      //response from the server.
      timer2 = new TreeDataTimer(this);
      timer2.start();
      timer2.join();

 }

The other, most annoying problem I have, is that whenever I do expand on a
node getChildCount(...) winds up getting called three times.  The only thing
I can think of is it is being called this many times because of the three
stages of mouse movements:  mouseDown, mouseClick, and mouseUp. I'm thinking
that perhaps each of these are firing an event causing the
getChildCount(...) method to also fire three times.  I need somehow to stop
it from doing that and only call the getChildCount(...) method only once.

Please look over by code below and recommend what I need to do to make it
work properly.  I'm tacking on both my Response.java and MyTreeModel.java
classes so that you can see both.  I'll edit out methods not pertinent to
the problem.  Any recommendations you have I will try.

Thanks,

Alan

*************************************************************

public class Response extends Thread implements TreeWillExpandListener,
TreeModelListener
{

  clientInterface ref;
  JTree jTree1 = null;
  DataInputStream input;
  DefaultTreeNode rootNode;
  String FileSelected = "";
  String clientOS = "";
  boolean gotSendTreeDataMessage;
  long FileSize = 0;
  MyTreeModel model = null;
  DefaultTreeNode expandingNode = null;

  public Response(clientInterface reference)
  {
      ref = reference;
      clientOS = getPlatform();
      ConnectDataInputStream();

  }

  protected void ConnectDataInputStream()
  { //System.out.println("Entering ConnectDataInputStream method.");
    try
    {
      input = new DataInputStream(ref.connection1.getInputStream());
    }
    catch(IOException ioe)
    {

    }
  }

  private int contains(String st, String stringToSearchFor)
  {
    return st.indexOf(stringToSearchFor);
  }

  private String getPlatform()
  {
    String platform = System.getProperty("os.name");
    //System.out.println("Platform = " + platform);

    if(contains(platform, "Unix") > -1)
    {
      return String.valueOf(clientInterface.UNIX);
    }
    else if(contains(platform, "Linux") > -1)
    {
      return String.valueOf(clientInterface.LINUX);
    }
    return String.valueOf(clientInterface.WINDOWS);
  }


  /**
   * As this class extends class Thread, it is required we overwrite
   * the run() method.
   */
  public void run()
  {
      int connected = 0;
      //First let's try to connect to the server.
      try
      {

         //We need to send our username and password
         //before the server will return our home directory.
         String out = ref.username + ":" + ref.password + ":" + clientOS;
         //System.out.println("UserName&Password = " + out);
         ref.RequestOut.output.writeUTF(out);
         ref.RequestOut.output.flush();

         while(true) //Wait for a proper answer from the server.
         {
            connected = input.readInt();
            //System.out.println(connected);
            if(connected == ref.ACCEPTED || connected == ref.FAILED ||
connected == ref.PASSWORD_INVALID)
              break;
         }
         if (connected == ref.ACCEPTED)
         {
            //Get the users' home directory rootPath from the server
            ref.rootPath = input.readUTF();
            //System.out.println(ref.rootPath);
            int OS = input.readInt();
            if(OS == ref.WINDOWS)
              ref.serverOS = "Windows";
            else if(OS == ref.UNIX)
              ref.serverOS = "Unix";
            else
              ref.serverOS = "Linux";
            ref.setTitle(ref.getTitle() + " - Connection successful.");
            ref.jLabel1.setText("Status: ");
            ref.connected = true;
            //extract the name of the last directory name
     //from ref.rootPath. and populate JTree with one root Node
     String root = getNodeName(ref.rootPath);
            populateTree(root);
            //reset icon and text for connection labels
            ref.imageLabel.setIcon(ref.blank);
            ref.textLabel.setText("");
            //Enable menus
            ref.jMenuItem23.setEnabled(true); //Directories/MkDir
            ref.jMenuItem24.setEnabled(true); //Directories/RmDir
            ref.jMenuItem25.setEnabled(true); //Upload/Graphic Files
            ref.jMenuItem26.setEnabled(true); //Upload/Flash Files
            ref.jMenuItem27.setEnabled(true); //Upload/Applet Files
            ref.jMenuItem28.setEnabled(true); //Upload/HTML Files
            ref.jMenuItem29.setEnabled(true); //Upload/Database Files
            ref.jMenuItem30.setEnabled(true); //Upload/Sound Files
            ref.jMenuItem31.setEnabled(true); //Upload/Compressed Files
            /*This try block will attempt to receive string info from the
server
            //in order that it can be used to reconstruct the directory
tree.
            try
            {
                //This could take a while depending on the users connection
speed,
                //so let him know he may have to wait a bit.
                ref.jLabel1.setText("Status: Please wait while the server
provides a directory tree.");
                //run the timer to check after 15 seconds if
gotSendTreeDataMessage
                //got set to true or not.
                timer.setThreadSuspended(false);
                connected = input.readInt();
                if(connected == ref.SENDING_TREE_DATA)
                {
                  gotSendTreeDataMessage = true;
    //extract the name of the last directory name
    //from ref.rootPath.
    String root = getNodeName(ref.rootPath);
                  populateTree(root);
                  //reset icon and text for connection labels
                  ref.imageLabel.setIcon(ref.blank);
                  ref.textLabel.setText("");
                  //Enable menus
                  ref.jMenuItem23.setEnabled(true); //Directories/MkDir
                  ref.jMenuItem24.setEnabled(true); //Directories/RmDir
                  ref.jMenuItem25.setEnabled(true); //Upload/Graphic Files
                  ref.jMenuItem26.setEnabled(true); //Upload/Flash Files
                  ref.jMenuItem27.setEnabled(true); //Upload/Applet Files
                  ref.jMenuItem28.setEnabled(true); //Upload/HTML Files
                  ref.jMenuItem29.setEnabled(true); //Upload/Database Files
                  ref.jMenuItem30.setEnabled(true); //Upload/Sound Files
                  ref.jMenuItem31.setEnabled(true); //Upload/Compressed
Files
                }

            }
            catch(NullPointerException npe)
            {
              //If we come in here it's only because there simply is no
connection
              //to the server application.
              ref.jLabel1.setText("Status: NullPointerException in
Response.run() method.");
              //reset icon and text for connection labels
              ref.imageLabel.setIcon(ref.blank);
              ref.textLabel.setText("");
              disableMenus(true);
              //System.out.println("NullPointerException during
input.readUTF() procedure.");
               npe.printStackTrace();
            }
             */
         }
         else if(connected == ref.FAILED)
         {
            ref.disconnect("Status: Unable to connect to server. Please
ensure your username is correct.");
            //reset icon and text for connection labels
            ref.imageLabel.setIcon(ref.blank);
            ref.textLabel.setText("");
            ref.connected = false;
            return;
         }
         else if(connected == ref.PASSWORD_INVALID)
         {
           ref.disconnect("Status: Unable to connect to server. Please
ensure your password is correct.");
           //reset icon and text for connection labels
           ref.imageLabel.setIcon(ref.blank);
           ref.textLabel.setText("");
           ref.connected = false;
           return;
         }
      }
      catch(NullPointerException npe)
      {
         //If we come in here it's only because there simply is no
connection
         //to the server application.
         ref.jLabel1.setText("Status: NullPointerException in Response.run()
method.");
         //reset icon and text for connection labels
         ref.connected = false;
         ref.imageLabel.setIcon(ref.blank);
         ref.textLabel.setText("");
         //System.out.println("outer NullPointerException while attempting
to connect.");
         input = null; //reset
         disableMenus(true);
         npe.printStackTrace();
         return;
      }
      catch(IOException e)
      {
         ref.jLabel1.setText("Status: IOException in Response.run()
method.");
         JOptionPane.showMessageDialog(ref, "IOException in Response.run()
method.\n" +
                                       "This is caused either by a loss of
connection\n" +
                                       "to the server, or there is
interference\n" +
                                       "facilitated by other Parental
Internet\n" +
                                       "Filtering software running on your
workstation.\n" +
                                       "If this is the case, disable the
filtering\n" +
                                       "software, then attempt to reconnect
to the server.");
         //reset icon and text for connection labels
         ref.connected = false;
         ref.imageLabel.setIcon(ref.blank);
         ref.textLabel.setText("");
         disableMenus(true);
         //e.printStackTrace();
         //There may still be a connection to the server,
         //However, there is sometimes interference due
         //to Internet Filtering Software. So we'll send
         //a quit message back to the server and allow the user
         //to attempt a reconnect.
         try{
         ref.RequestOut.output.writeInt(ref.QUIT);
         ref.RequestOut.output.flush();
         }catch(IOException ioe){}
         return;
      }
      catch(Exception ex)
      {
         ref.jLabel1.setText("Status: Exception in Response.run() method.");
         //reset icon and text for connection labels
         ref.connected = false;
         ref.imageLabel.setIcon(ref.blank);
         ref.textLabel.setText("");
         ex.printStackTrace();
         disableMenus(true);
         return;
      }
      //Now handle Responses from the server
      ref.jLabel1.setText("Status:");
      ListenForResponses();


  }

  private void ListenForResponses()
  {
      int connected = 0;
      while(true)
      {
         try
         {
            //System.out.println("Reading next response...");
            connected = input.readInt();
            //System.out.println("connected: " + connected);
            if(connected == ref.DOWNLOAD_FILE)
            {
               FileSize = input.readLong();
               receiveFile();
            }
            else if(connected == ref.ERROR_SAVING)
            {
               ref.jLabel1.setText("Status: Error Saving " + ref.FileOpen);
               ref.imageLabel.setIcon(ref.blank);
               ref.textLabel.setText("");
               ref.isDirty = true;
            }
            else if(connected == ref.ALLOTTED_WEBSPACE_USED_UP)
            {
              ref.imageLabel.setIcon(ref.blank);
              ref.textLabel.setText("");
              ref.RequestOut.WebSpaceFull = true;
              JOptionPane.showMessageDialog(ref, "If you are attempting to
save/upload a new file, or upload multiple files,\n" +
                                                 "you do not have enough
allotted web space to accomodate the file(s).\n" +
                                                 "If you require more space,
contact your System Administrator.", "Message", JOptionPane.PLAIN_MESSAGE);
              ref.jLabel1.setText("Status:");
            }
            else if(connected == ref.WEBSPACE_NOT_USED_UP)
            { //System.out.println("Got the go ahead.");
              ref.RequestOut.proceed = true;
            }
            else if(connected == ref.SAVE_SUCCESSFUL)
            {
               //we only get this if the user has used the File/SaveAs menu.
               refreshTree();
               ref.jLabel1.setText("Status: Save Successful");
               ref.isDirty = false;
            }
            else if(connected == ref.SAVE_UNSUCCESSFUL)
            {
               ref.jLabel1.setText("Status: Save Not Successful");
               ref.imageLabel.setIcon(ref.blank);
               ref.textLabel.setText("");
            }
            else if(connected == ref.UPLOAD_SUCCESSFUL)
            {  //System.out.println("Got Upload Successful");
               refreshTree();
               ref.jLabel1.setText("Status: Data Transfer Successful");
               ref.imageLabel.setIcon(ref.blank);
               ref.textLabel.setText("");
            }
            else if(connected == ref.UPLOAD_UNSUCCESSFUL)
            {
               ref.jLabel1.setText("Status: Data Transfer Not Successful");
               JOptionPane.showMessageDialog(ref, "The file(s) uploaded
were\n" +
                                                  "unsuccessful in their
completion.",
                                                  "Upload Status:",

JOptionPane.INFORMATION_MESSAGE);
               ref.imageLabel.setIcon(ref.blank);
               ref.textLabel.setText("");
            }
            else if(connected == ref.UPLOAD_UNSUCCESSFUL_SECURITY_EXCEPTION)
            {
               ref.jLabel1.setText("Status: Data Transfer Not Successful,
Security Exception");
               JOptionPane.showMessageDialog(ref, "The file(s) uploaded
were\n" +
                                                  "unsuccessful in their
completion.\n" +
                                                  "There was a problem
regarding security\n" +
"access. See your System Administrator for help.",
                                                  "Upload Status:",

JOptionPane.INFORMATION_MESSAGE);
               ref.imageLabel.setIcon(ref.blank);
               ref.textLabel.setText("");
            }
            else if(connected == ref.DIRECTORY_CREATION_SUCCESSFUL)
            {
               refreshTree();
               ref.jLabel1.setText("Status: Directory creation successful");
            }
            else if(connected == ref.DIRECTORY_CREATION_UNSUCCESSFUL)
            {
             ref.jLabel1.setText("Status: Directory creation not
successful");
             ref.imageLabel.setIcon(ref.blank);
             ref.textLabel.setText("");
            }
            else if(connected == ref.DIRECTORY_DELETION_SUCCESSFUL)
            {
               refreshTree();
               ref.jLabel1.setText("Status: Directory Deletion Successful");
            }
            else if(connected == ref.DIRECTORY_DELETION_UNSUCCESSFUL)
            {
              ref.jLabel1.setText("Status: Directory Deletion Not
Successful");
              ref.imageLabel.setIcon(ref.blank);
              ref.textLabel.setText("");
            }
            else if(connected == ref.FILE_NOT_FOUND_EXCEPTION)
            {
               ref.jLabel1.setText("Status: FileNotFoundException. Perhaps
the node is really an empty directory?");
               ref.isDirty = false;
               ref.setTitle("JText Editor - Connection successful.");
               ref.imageLabel.setIcon(ref.blank);
               ref.textLabel.setText("");
            }
            else if(connected == ref.SERVER_RESET)
            {
               ref.jLabel1.setText("Status: The main server is being
manually reset. You have been disconnected.");
               ref.setTitle("JText Editor");
               disableMenus(true);
            }
            else if(connected == ref.SERVER_SHUTTING_DOWN)
            {
               ref.jLabel1.setText("Status: The main server is being turned
off. You have been disconnected.");
               ref.setTitle("JText Editor");
               disableMenus(true);
            }
            else if(connected == ref.SENDING_TREE_DATA)
            {
               System.out.println("Received message: SendingTreeData");
               model.setGotTreeData(true);
               model.ReceiveChildrenFromServer(expandingNode,
expandingNode.getWholeServerPath(), input);
               //expandingNode = null;//reset
               ref.imageLabel.setIcon(ref.blank);
               ref.textLabel.setText("");
            }
            else if(connected == ref.SENDING_CHILDCOUNT)
            {
               System.out.println("Received message: SendingChildCount");
               model.setRequestedChildCount(input.readInt());
               model.setReceivedChildCount(true);
               ref.imageLabel.setIcon(ref.blank);
               ref.textLabel.setText("");
            }
            else if(connected == ref.PASSWORD_CHANGE_SUCCESSFUL)
            {
              ref.jLabel1.setText("Status: Password changed successfully.");
              ref.imageLabel.setIcon(ref.blank);
              ref.textLabel.setText("");
            }
            else if(connected == ref.PASSWORD_CHANGE_NOT_SUCCESSFUL)
            {
              ref.jLabel1.setText("Status: Password change not successful.
See your administrator for help.");
              ref.imageLabel.setIcon(ref.blank);
              ref.textLabel.setText("");
            }
            else if(connected == ref.FILE_DELETION_SUCCESSFUL)
            {
               ref.jLabel1.setText("Status: File Deleted Successfully.");
               //Now, refresh the tree.
               refreshTree();
            }
            else if(connected == ref.FILE_DELETION_UNSUCCESSFUL)
            {
               ref.jLabel1.setText("Status: File Deletion Not Successful.");
               ref.imageLabel.setIcon(ref.blank);
               ref.textLabel.setText("");
            }
            else if(connected == ref.FILE_RENAME_SUCCESSFUL)
            {
               ref.jLabel1.setText("Status: File Rename Successful.");
               //Now, refresh the tree.
               refreshTree();
            }
            else if(connected == ref.FILE_RENAME_UNSUCCESSFUL)
            {
               ref.jLabel1.setText("Status: File Rename Not Successful.");
               ref.imageLabel.setIcon(ref.blank);
               ref.textLabel.setText("");
            }
            else if(connected == ref.FILE_CONTENTS)
            {
               //System.out.println("Received queue from server for file
contents.");
               FileSize = input.readLong();
               displayTextFile();
               ref.isDirty = false;

               //System.out.println("Finished receiving file");
            }

       }
       catch(EOFException eof){break;}
       catch(NullPointerException npex)
       {
          //If we come in here it's only because there simply is no
connection
          //to the server application.
          ref.jLabel1.setText("NullPointerException in run() method of
communicationPort.");
          npex.printStackTrace();
          ref.imageLabel.setIcon(ref.blank);
          //System.out.println("NullPointerException during input.readUTF()
procedure of communicationPort.");
          disableMenus(true);
          break;
       }
       catch(IOException e)
       {
          ref.jLabel1.setText("Status: Client disconnected.");
          ref.imageLabel.setIcon(ref.blank);
          disableMenus(true);
          //e.printStackTrace();
          break;
       }
       catch(Exception exc)
       {
          ref.jLabel1.setText("Status: Client disconnected.");
          ref.imageLabel.setIcon(ref.blank);
          disableMenus(true);
          //exc.printStackTrace();
          break;
       }
     }
  }


  /**
   * This function creates an instance of a JTree object and populates
   * it with the data sent by Directory Administrator.
   */
  protected void populateTree(String NodeName)
  {
    //System.out.println("Entering populatTree() method");
    //This could take a while, so change the cursor icon
    //ref.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    try
    {
        String separator = "";
        if(ref.serverOS.equals("Windows"))
            separator = "\\";
        else
            separator = "/";
        rootNode = new DefaultTreeNode(NodeName, true, separator);
        String rootPath = getLeadingPath(ref.rootPath);
        rootNode.setLeadingPath(rootPath);
        //insert child nodes
        model = new MyTreeModel(rootNode);
        model.setOutputStream(ref.RequestOut.output);
        model.setResponseReference(this);
        model.addTreeModelListener(this);
        //model.setInputStream(input);
        //model.ReceiveChildrenFromServer(rootNode,
rootNode.getWholeServerPath());
        jTree1 = new JTree(model);
        jTree1.setRootVisible(true);
        jTree1.setShowsRootHandles(true);
        jTree1.collapseRow(0);
        MouseListener popupListener = new PopupListener(ref);
        jTree1.addMouseListener(popupListener);

        //Listen to our own expand/collapse events to keep the labels in
sync
        jTree1.addTreeWillExpandListener(this);

    }
    catch(Exception e){System.out.println("Exception in populateTree()
method"); e.printStackTrace();return;}


    jTree1.addTreeSelectionListener(new TreeSelectionListener()
    {
      public void valueChanged(TreeSelectionEvent tse)
      {
        System.out.println("valueChanged");
        DefaultTreeNode temp;
        if(ref.connected)
        {
          try
          {
              TreePath tp = tse.getNewLeadSelectionPath();
              /**
              * SelectedFilePath IS VERY IMPORTANT!
              * It will contain the complete path to the file
              * clicked on by the user's mouse.
              * We can then use it to actually open the file on the server
side.
              */
              ref.SelectedFilePath = ref.getWholePath(tp.toString());
              //SelectedTreePath = tp.toString();
              //System.out.println(ref.FileOpenPath);
              temp = (DefaultTreeNode)tp.getLastPathComponent();
              String st = tp.getLastPathComponent().toString();
              ref.SelectedFile = st;
              FileSelected = st;
              ref.jLabel1.setText("Selected: " + st);

              //We need to toggle the File/Open, Save, and SaveAs menus from
enabled to disabled
              //depending on what the user is selecting.  We don't want
              //the user trying to open a directory.  They should only
              //be allowed to open and save leaf objects (files).
              if(temp.isLeaf())
              {
                //System.out.println("This node is a leaf.");
                //Enable menus
                ref.jMenuItem1.setEnabled(true); //File/New
                ref.jMenuItem2.setEnabled(true); //File/New with HTML Tags
                ref.jMenuItem3.setEnabled(true); //File/Open
                ref.popopenFile.setEnabled(true); //File/Open
                if(ref.FileOpen.equals("")) //nothing has been opened
                {
                  ref.jMenuItem4.setEnabled(false); //File/Save
                  ref.Save.setEnabled(false); //File/Save button
                  ref.jMenuItem5.setEnabled(false); //File/SaveAs
                  ref.popsaveFile.setEnabled(false);
                  ref.popsaveFileAs.setEnabled(false);
                }
                else if(ref.FileOpen.equals(ref.SelectedFile)) //the
selected file and the open file are the same
                {
                  ref.jMenuItem4.setEnabled(true); //File/Save
                  ref.Save.setEnabled(true); //File/Save Button
                  ref.jMenuItem5.setEnabled(true); //File/SaveAs
                  ref.popsaveFile.setEnabled(true);
                  ref.popsaveFileAs.setEnabled(true);
                }
                else //the selected file and the open file are not the same
                {
                  ref.jMenuItem4.setEnabled(false); //File/Save
                  ref.Save.setEnabled(false); //File/Save Button
                  ref.jMenuItem5.setEnabled(false); //File/SaveAs
                  ref.popsaveFile.setEnabled(false);
                  ref.popsaveFileAs.setEnabled(false);
                }
                ref.jMenuItem6.setEnabled(true); //File/Delete
                ref.jMenuItem7.setEnabled(true); //File/Rename
                ref.jMenuItem8.setEnabled(true); //File/Download
                ref.jMenuItem9.setEnabled(true); //File/Print
                //enable popup menus
                ref.popdeleteFile.setEnabled(true); //File/Delete
                ref.poprenameFile.setEnabled(true); //File/Rename
                ref.popdownloadFile.setEnabled(true); //File/Download

                //Enable buttons
                ref.New.setEnabled(true);
                ref.Open.setEnabled(true);
                ref.Print.setEnabled(true);
                ref.Tags.setEnabled(true);
              }
              else
              {
                //System.out.println("This node is a not a leaf.");
                //Disable menus
                ref.jMenuItem1.setEnabled(false); //File/New
                ref.jMenuItem2.setEnabled(false); //File/New with HTML
                ref.jMenuItem3.setEnabled(false); //File/Open
                ref.jMenuItem4.setEnabled(false); //File/Save
                ref.jMenuItem5.setEnabled(false); //File/SaveAs
                ref.jMenuItem6.setEnabled(false); //File/Delete
                ref.jMenuItem7.setEnabled(false); //File/Rename
                ref.jMenuItem8.setEnabled(false); //File/Download
                ref.jMenuItem9.setEnabled(false); //File/Print
                //Disable popup menus
                ref.popopenFile.setEnabled(false); //File/Open
                ref.popsaveFile.setEnabled(false); //File/Save
                ref.popsaveFileAs.setEnabled(false); //File/SaveAs
                ref.popdeleteFile.setEnabled(false); //File/Delete
                ref.poprenameFile.setEnabled(false); //File/Rename
                ref.popdownloadFile.setEnabled(false); //File/Download
                //From -7100215599787870266
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,76fdbd0f345b0d02
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2003-10-22 10:15:38 PST
Date: Wed, 22 Oct 2003 11:08:12 -0600
From: "Tad Frysinger [TeamB]" <tfrysinger@earthlink.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing
Subject: Re: Antialiasing
References: <pan.2003.10.09.00.13.58.656411@mt.net.mk>
In-Reply-To: <pan.2003.10.09.00.13.58.656411@mt.net.mk>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 206.61.185.113
Message-ID: <3f96b98c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1066842508 206.61.185.113 (22 Oct 2003 10:08:28 -0700)
Lines: 12
Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
Xref: archiver1.google.com borland.public.jbuilder.java.swing:57

Aleksandar Pecanov wrote:

> Is it possible to set the default value of RenderingHints.KEY_ANTIALIASING
> to on?
Doing a quick search yields no apparant way to do this. It doesn't 
appear that there is any setting of defaults within the Graphics sources 
either. I think you are stuck with subclassing or overriding each 
component affected where you need this behavior.

-- 
Tad Frysinger [TeamB]
Technical Details
Message-ID: <3fa29f8b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!news.astraweb.com!news-small.astraweb.com!news-out.spamkiller.net!propagator2-maxim!news-in-maxim.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f9ae29b$1@newsgroups.borland.com> <u3cdgqvx4.fsf@ergo.no> <3f9c6527$2@newsgroups.borland.com> <3f9e8645$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,63f1d22919caaa01
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2003-10-31 09:48:12 PST
From: "Alan Shiers" <ashiers@hfx.eastlink.ca>
Newsgroups: borland.public.jbuilder.java.swing
References: <3f9ae29b$1@newsgroups.borland.com> <u3cdgqvx4.fsf@ergo.no> <3f9c6527$2@newsgroups.borland.com> <3f9e8645$1@newsgroups.borland.com>
Subject: Re: displaying child nodes on demand
Date: Fri, 31 Oct 2003 13:37:02 -0400
Lines: 1053
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 24.222.101.2
Message-ID: <3fa29f8b@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1067622283 24.222.101.2 (31 Oct 2003 09:44:43 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!news.astraweb.com!news-small.astraweb.com!news-out.spamkiller.net!propagator2-maxim!news-in-maxim.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail