diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 2 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README b/README new file mode 100644 index 0000000..77f4d25 --- /dev/null +++ b/README @@ -0,0 +1,9 @@ +Running the script build-jar will compile the java source files and generate the runtime SelekTOR.jar file. + +The following dependencies are required to be met in order for the compile to complete successfully. + +openjdk-7-jdk. +proguard 4.8 or better. + +Regards +Alistair Neil (info@dazzleships.net) diff --git a/build-jar b/build-jar new file mode 100755 index 0000000..e7835b0 --- /dev/null +++ b/build-jar @@ -0,0 +1,18 @@ +#!/bin/sh +# -*- mode: sh; tab-width: 8; encoding: utf-8-unix -*- + +#Create our build folder + +ROLE=privacy + +#Create our build folder +[ -d build ] || mkdir build +#Java compilation +javac -nowarn -d build -sourcepath src src/SelekTOR.java +# Build runtime jar +jar -cfe build/SelekTOR.jar SelekTOR -C build . -C src resources +#Do proguard code optimisation +# proguard -forceprocessing -include SelekTOR.pro -injars build/SelekTOR.jar -outjars SelekTOR.jar +# Cleanup +# rm build -rf +cp -p build/SelekTOR.jar . diff --git a/javadoc/SelekTOR.html b/javadoc/SelekTOR.html new file mode 100644 index 0000000..90e4530 --- /dev/null +++ b/javadoc/SelekTOR.html @@ -0,0 +1,287 @@ + + + + + + +SelekTOR (SelekTOR Java Documentation) + + + + + + + + + + + + +
+

Class SelekTOR

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • SelekTOR
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class SelekTOR
    +extends java.lang.Object
    +
    Explanation of why this is in the default package
    +
    +
    Author:
    +
    Alistair Neil + + The app launcher is here in the default package which should not normally be + used. The method java uses to launche its apps is not fully compatible with + various Linux launchers panels such as Dockbarx or Unity launchers and thus + confuses those apps. By putting this simple launch handle here in the default + package the Linux dockpanel launchers should function correctly when it + commes to application pinning.
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      SelekTOR() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SelekTOR

        +
        public SelekTOR()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +
        +
        Parameters:
        +
        args - the command line arguments
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/allclasses-frame.html b/javadoc/allclasses-frame.html new file mode 100644 index 0000000..71a3f60 --- /dev/null +++ b/javadoc/allclasses-frame.html @@ -0,0 +1,50 @@ + + + + + + +All Classes (SelekTOR Java Documentation) + + + + + +

All Classes

+ + + diff --git a/javadoc/allclasses-noframe.html b/javadoc/allclasses-noframe.html new file mode 100644 index 0000000..c0c1eb1 --- /dev/null +++ b/javadoc/allclasses-noframe.html @@ -0,0 +1,50 @@ + + + + + + +All Classes (SelekTOR Java Documentation) + + + + + +

All Classes

+ + + diff --git a/javadoc/class-use/SelekTOR.html b/javadoc/class-use/SelekTOR.html new file mode 100644 index 0000000..1158109 --- /dev/null +++ b/javadoc/class-use/SelekTOR.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class SelekTOR (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
SelekTOR

+
+
No usage of SelekTOR
+ + + + + + diff --git a/javadoc/client/ExitNodeTableModel.html b/javadoc/client/ExitNodeTableModel.html new file mode 100644 index 0000000..0f2ed70 --- /dev/null +++ b/javadoc/client/ExitNodeTableModel.html @@ -0,0 +1,619 @@ + + + + + + +ExitNodeTableModel (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class ExitNodeTableModel

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.swing.table.AbstractTableModel
    • +
    • +
        +
      • javax.swing.table.DefaultTableModel
      • +
      • +
          +
        • client.ExitNodeTableModel
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, javax.swing.table.TableModel
    +
    +
    +
    +
    public class ExitNodeTableModel
    +extends javax.swing.table.DefaultTableModel
    +
    +
    Author:
    +
    Alistair Neil
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javax.swing.table.DefaultTableModel

        +columnIdentifiers, dataVector
      • +
      +
        +
      • + + +

        Fields inherited from class javax.swing.table.AbstractTableModel

        +listenerList
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      ExitNodeTableModel() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddRow(java.lang.Object[] rowData) +
      Add rowdata with given data object array
      +
      voidclear() +
      Clear the table model of all data
      +
      java.lang.ClassgetColumnClass(int index) +
      Get column class at given index
      +
      intgetColumnCount() +
      Get the number of columns
      +
      java.lang.StringgetColumnName(int index) +
      Get column name at given index
      +
      NodeItemgetNodeItemAt(int row) +
      Get row nodeitem
      +
      java.lang.ObjectgetValueAt(int row, + int col) +
      Get cell value as object at row,col
      +
      booleanisCellEditable(int row, + int col) +
      Test if the cell is editable
      +
      voidsetColumnName(java.lang.String name, + int index) +
      Set the column name at the specified index
      +
      voidsetTestFieldValues(java.lang.String finger, + long latency, + java.lang.String status, + java.lang.String hops) +
      Convenience method to set the testing field cell values for a specific + fingerprint, the hops field is hidden and does npt show up in table
      +
      voidsetValueAt(java.lang.Object value, + int row, + int col) +
      Set cell value at row,col
      +
      voidsetValueAt(java.lang.Object value, + java.lang.String finger, + int col) +
      Set value with given fingerprint at given column
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.table.DefaultTableModel

        +addColumn, addColumn, addColumn, addRow, convertToVector, convertToVector, getDataVector, getRowCount, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
      • +
      +
        +
      • + + +

        Methods inherited from class javax.swing.table.AbstractTableModel

        +addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ExitNodeTableModel

        +
        public ExitNodeTableModel()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        clear

        +
        public void clear()
        +
        Clear the table model of all data
        +
      • +
      + + + +
        +
      • +

        getColumnCount

        +
        public int getColumnCount()
        +
        Get the number of columns
        +
        +
        Specified by:
        +
        getColumnCount in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getColumnCount in class javax.swing.table.DefaultTableModel
        +
        Returns:
        +
        columns as integer
        +
        +
      • +
      + + + +
        +
      • +

        isCellEditable

        +
        public boolean isCellEditable(int row,
        +                              int col)
        +
        Test if the cell is editable
        +
        +
        Specified by:
        +
        isCellEditable in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        isCellEditable in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        row - Cell row
        +
        col - Cell column
        +
        Returns:
        +
        True if editable
        +
        +
      • +
      + + + +
        +
      • +

        setValueAt

        +
        public void setValueAt(java.lang.Object value,
        +                       java.lang.String finger,
        +                       int col)
        +
        Set value with given fingerprint at given column
        +
        +
        Parameters:
        +
        value - Value
        +
        finger - Fingerprint
        +
        col - Column
        +
        +
      • +
      + + + +
        +
      • +

        setTestFieldValues

        +
        public void setTestFieldValues(java.lang.String finger,
        +                               long latency,
        +                               java.lang.String status,
        +                               java.lang.String hops)
        +
        Convenience method to set the testing field cell values for a specific + fingerprint, the hops field is hidden and does npt show up in table
        +
        +
        Parameters:
        +
        finger - Fingerprint
        +
        latency - Latency value
        +
        status - Status value
        +
        hops - Hops value
        +
        +
      • +
      + + + +
        +
      • +

        getNodeItemAt

        +
        public NodeItem getNodeItemAt(int row)
        +
        Get row nodeitem
        +
        +
        Parameters:
        +
        row -
        +
        Returns:
        +
        a nodeitem
        +
        +
      • +
      + + + +
        +
      • +

        setValueAt

        +
        public void setValueAt(java.lang.Object value,
        +                       int row,
        +                       int col)
        +
        Set cell value at row,col
        +
        +
        Specified by:
        +
        setValueAt in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        setValueAt in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        value -
        +
        row -
        +
        col -
        +
        +
      • +
      + + + +
        +
      • +

        getValueAt

        +
        public java.lang.Object getValueAt(int row,
        +                                   int col)
        +
        Get cell value as object at row,col
        +
        +
        Specified by:
        +
        getValueAt in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getValueAt in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        row -
        +
        col -
        +
        Returns:
        +
        value as object
        +
        +
      • +
      + + + +
        +
      • +

        addRow

        +
        public void addRow(java.lang.Object[] rowData)
        +
        Add rowdata with given data object array
        +
        +
        Overrides:
        +
        addRow in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        rowData -
        +
        +
      • +
      + + + +
        +
      • +

        getColumnName

        +
        public java.lang.String getColumnName(int index)
        +
        Get column name at given index
        +
        +
        Specified by:
        +
        getColumnName in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getColumnName in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        index -
        +
        Returns:
        +
        name as string
        +
        +
      • +
      + + + +
        +
      • +

        setColumnName

        +
        public void setColumnName(java.lang.String name,
        +                          int index)
        +
        Set the column name at the specified index
        +
        +
        Parameters:
        +
        name -
        +
        index -
        +
        +
      • +
      + + + +
        +
      • +

        getColumnClass

        +
        public java.lang.Class getColumnClass(int index)
        +
        Get column class at given index
        +
        +
        Specified by:
        +
        getColumnClass in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getColumnClass in class javax.swing.table.AbstractTableModel
        +
        Parameters:
        +
        index -
        +
        Returns:
        +
        Class
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/GuardNodeDialog.html b/javadoc/client/GuardNodeDialog.html new file mode 100644 index 0000000..fbdbfab --- /dev/null +++ b/javadoc/client/GuardNodeDialog.html @@ -0,0 +1,528 @@ + + + + + + +GuardNodeDialog (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class GuardNodeDialog

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • java.awt.Window
        • +
        • +
            +
          • java.awt.Dialog
          • +
          • +
              +
            • javax.swing.JDialog
            • +
            • +
                +
              • client.GuardNodeDialog
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    +
    +
    +
    +
    public class GuardNodeDialog
    +extends javax.swing.JDialog
    +
    +
    Author:
    +
    Alistair Neil
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JDialog

        +javax.swing.JDialog.AccessibleJDialog
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Dialog

        +java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Window

        +java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static intAPPLY 
      static intCANCEL 
      static intRESET 
      +
        +
      • + + +

        Fields inherited from class javax.swing.JDialog

        +accessibleContext, rootPane, rootPaneCheckingEnabled
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Dialog

        +DEFAULT_MODALITY_TYPE
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface javax.swing.WindowConstants

        +DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      GuardNodeDialog(java.awt.Frame parent, + boolean modal) +
      Creates new form GuardNodeDialog
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      intgetReturnStatus() 
      voidsetNodeList(NodeList nl) +
      Set the nodelist
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JDialog

        +addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Dialog

        +addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Window

        +addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GuardNodeDialog

        +
        public GuardNodeDialog(java.awt.Frame parent,
        +                       boolean modal)
        +
        Creates new form GuardNodeDialog
        +
        +
        Parameters:
        +
        parent -
        +
        modal -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setNodeList

        +
        public void setNodeList(NodeList nl)
        +
        Set the nodelist
        +
        +
        Parameters:
        +
        nl -
        +
        +
      • +
      + + + +
        +
      • +

        getReturnStatus

        +
        public int getReturnStatus()
        +
        +
        Returns:
        +
        the return status of this dialog - one of RET_OK or RET_CANCEL
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/GuardNodeTableModel.html b/javadoc/client/GuardNodeTableModel.html new file mode 100644 index 0000000..83213fb --- /dev/null +++ b/javadoc/client/GuardNodeTableModel.html @@ -0,0 +1,579 @@ + + + + + + +GuardNodeTableModel (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class GuardNodeTableModel

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.swing.table.AbstractTableModel
    • +
    • +
        +
      • javax.swing.table.DefaultTableModel
      • +
      • +
          +
        • client.GuardNodeTableModel
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, javax.swing.table.TableModel
    +
    +
    +
    +
    public class GuardNodeTableModel
    +extends javax.swing.table.DefaultTableModel
    +
    +
    Author:
    +
    Alistair Neil
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javax.swing.table.DefaultTableModel

        +columnIdentifiers, dataVector
      • +
      +
        +
      • + + +

        Fields inherited from class javax.swing.table.AbstractTableModel

        +listenerList
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddRow(java.lang.Object[] rowData) +
      Add rowdata with given data object array
      +
      voidclear() +
      Clear the table model of all data
      +
      java.lang.ClassgetColumnClass(int index) +
      Get column class at given index
      +
      intgetColumnCount() +
      Get the number of columns
      +
      java.lang.StringgetColumnName(int index) +
      Get column name at given index
      +
      intgetEnabledCount() 
      java.lang.ObjectgetValueAt(int row, + int col) +
      Get cell value as object at row,col
      +
      booleanisCellEditable(int row, + int col) +
      Test if the cell is editable
      +
      voidsetColumnName(java.lang.String name, + int index) +
      Set the column name at the specified index
      +
      voidsetValueAt(java.lang.Object value, + int row, + int col) +
      Set cell value at row,col
      +
      voidsetValueAt(java.lang.Object value, + java.lang.String finger, + int col) +
      Set value with given fingerprint at given column
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.table.DefaultTableModel

        +addColumn, addColumn, addColumn, addRow, convertToVector, convertToVector, getDataVector, getRowCount, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
      • +
      +
        +
      • + + +

        Methods inherited from class javax.swing.table.AbstractTableModel

        +addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GuardNodeTableModel

        +
        public GuardNodeTableModel()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getEnabledCount

        +
        public int getEnabledCount()
        +
      • +
      + + + +
        +
      • +

        clear

        +
        public void clear()
        +
        Clear the table model of all data
        +
      • +
      + + + +
        +
      • +

        getColumnCount

        +
        public int getColumnCount()
        +
        Get the number of columns
        +
        +
        Specified by:
        +
        getColumnCount in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getColumnCount in class javax.swing.table.DefaultTableModel
        +
        Returns:
        +
        columns as integer
        +
        +
      • +
      + + + +
        +
      • +

        isCellEditable

        +
        public boolean isCellEditable(int row,
        +                              int col)
        +
        Test if the cell is editable
        +
        +
        Specified by:
        +
        isCellEditable in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        isCellEditable in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        row - Cell row
        +
        col - Cell column
        +
        Returns:
        +
        True if editable
        +
        +
      • +
      + + + +
        +
      • +

        setValueAt

        +
        public void setValueAt(java.lang.Object value,
        +                       java.lang.String finger,
        +                       int col)
        +
        Set value with given fingerprint at given column
        +
        +
        Parameters:
        +
        value - Value
        +
        finger - Fingerprint
        +
        col - Column
        +
        +
      • +
      + + + +
        +
      • +

        setValueAt

        +
        public void setValueAt(java.lang.Object value,
        +                       int row,
        +                       int col)
        +
        Set cell value at row,col
        +
        +
        Specified by:
        +
        setValueAt in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        setValueAt in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        value -
        +
        row -
        +
        col -
        +
        +
      • +
      + + + +
        +
      • +

        getValueAt

        +
        public java.lang.Object getValueAt(int row,
        +                                   int col)
        +
        Get cell value as object at row,col
        +
        +
        Specified by:
        +
        getValueAt in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getValueAt in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        row -
        +
        col -
        +
        Returns:
        +
        value as object
        +
        +
      • +
      + + + +
        +
      • +

        addRow

        +
        public void addRow(java.lang.Object[] rowData)
        +
        Add rowdata with given data object array
        +
        +
        Overrides:
        +
        addRow in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        rowData -
        +
        +
      • +
      + + + +
        +
      • +

        getColumnName

        +
        public java.lang.String getColumnName(int index)
        +
        Get column name at given index
        +
        +
        Specified by:
        +
        getColumnName in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getColumnName in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        index -
        +
        Returns:
        +
        name as string
        +
        +
      • +
      + + + +
        +
      • +

        setColumnName

        +
        public void setColumnName(java.lang.String name,
        +                          int index)
        +
        Set the column name at the specified index
        +
        +
        Parameters:
        +
        name -
        +
        index -
        +
        +
      • +
      + + + +
        +
      • +

        getColumnClass

        +
        public java.lang.Class getColumnClass(int index)
        +
        Get column class at given index
        +
        +
        Specified by:
        +
        getColumnClass in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getColumnClass in class javax.swing.table.AbstractTableModel
        +
        Parameters:
        +
        index -
        +
        Returns:
        +
        Class
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/NodeItem.html b/javadoc/client/NodeItem.html new file mode 100644 index 0000000..b613a11 --- /dev/null +++ b/javadoc/client/NodeItem.html @@ -0,0 +1,1108 @@ + + + + + + +NodeItem (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class NodeItem

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • client.NodeItem
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.lang.Cloneable
    +
    +
    +
    +
    public class NodeItem
    +extends java.lang.Object
    +implements java.lang.Cloneable
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      NodeItem() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidclearType() +
      Clear node type
      +
      NodeItemclone() 
      floatgetBandwidth() +
      Get nodeitem bandwith
      +
      java.lang.StringgetCircuitHops() +
      Get circuit hops
      +
      java.lang.StringgetCountryCode() +
      Get nodeitem two letter country code abbreviation
      +
      java.lang.StringgetCountryName() +
      Get nodeitem full country name
      +
      java.lang.StringgetFingerprint() +
      Get nodeitems fingerprint
      +
      java.lang.StringgetIPAddress() +
      Get nodeitem ip address
      +
      longgetLatency() +
      Get Nodeitem latency in ms
      +
      java.lang.StringgetNickName() +
      Get nodeitem unique name
      +
      java.lang.StringgetStability() +
      Get Nodeitem stability
      +
      intgetStreams() +
      Get nodeitems active streams
      +
      java.lang.StringgetTestingMessage() +
      Get Node item status
      +
      longgetTestLatency() +
      Get Nodeitem test latency in ms
      +
      intgetTestStatus() +
      Get testing status flag
      +
      booleanisExit() +
      Is exit node
      +
      booleanisFavourite() +
      Get exit enabled status of Nodeitem
      +
      booleanisGuard() +
      Is Guard node
      +
      booleanisGuardEnabled() +
      Get guard enabled status of Nodeitem
      +
      booleanisHttpSupported() 
      booleanisNonUnique() 
      voidsetBandwidth(float bw) +
      Set node item bandwidth
      +
      voidsetCircuitHops(java.lang.String hops) +
      Set circuit hops
      +
      voidsetCountryCode(java.lang.String abrv) +
      Set Nodeitem with its two letter country code abbreviation
      +
      voidsetCountryName(java.lang.String name) +
      Set Nodeitem with its full country name
      +
      voidsetFavouriteEnabled(boolean enabled) +
      Set exit enabled status of Nodeitem
      +
      voidsetFingerprint(java.lang.String fp) +
      Set nodeitem fingerprint
      +
      voidsetGuardEnabled(boolean enabled) +
      Set guard enabled status of Nodeitem
      +
      voidsetHttpSupported(boolean supported) 
      voidsetIPAddress(java.lang.String ip) +
      Set nodeitem ip address
      +
      voidsetLatency(long latency) +
      Set Nodeitem latency value in ms
      +
      voidsetNickName(java.lang.String name) +
      Set nodeitem name
      +
      voidsetStable(java.lang.String stability) +
      Set Nodeitem stability yes/no/unknown
      +
      voidsetStreams(int streams) +
      Set nodeitem number of streams
      +
      voidsetTestingMessage(java.lang.String text) +
      Set Nodeitem testing status message
      +
      voidsetTestLatency(long latency) +
      Set Nodeitem test latency value in ms
      +
      voidsetTestStatus(int status) +
      Set testing status flag
      +
      voidsetType(int mask) +
      Set Node type
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        NodeItem

        +
        public NodeItem()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setType

        +
        public final void setType(int mask)
        +
        Set Node type
        +
        +
        Parameters:
        +
        mask -
        +
        +
      • +
      + + + +
        +
      • +

        clearType

        +
        public final void clearType()
        +
        Clear node type
        +
      • +
      + + + +
        +
      • +

        isNonUnique

        +
        public boolean isNonUnique()
        +
      • +
      + + + +
        +
      • +

        isExit

        +
        public final boolean isExit()
        +
        Is exit node
        +
        +
        Returns:
        +
        true if an exit node
        +
        +
      • +
      + + + +
        +
      • +

        isHttpSupported

        +
        public boolean isHttpSupported()
        +
      • +
      + + + +
        +
      • +

        setHttpSupported

        +
        public void setHttpSupported(boolean supported)
        +
      • +
      + + + +
        +
      • +

        isGuard

        +
        public final boolean isGuard()
        +
        Is Guard node
        +
        +
        Returns:
        +
        true if guard node
        +
        +
      • +
      + + + +
        +
      • +

        setCircuitHops

        +
        public final void setCircuitHops(java.lang.String hops)
        +
        Set circuit hops
        +
        +
        Parameters:
        +
        hops -
        +
        +
      • +
      + + + +
        +
      • +

        getCircuitHops

        +
        public final java.lang.String getCircuitHops()
        +
        Get circuit hops
        +
        +
        Returns:
        +
        Circuit hops as String
        +
        +
      • +
      + + + +
        +
      • +

        setTestingMessage

        +
        public final void setTestingMessage(java.lang.String text)
        +
        Set Nodeitem testing status message
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        setTestStatus

        +
        public final void setTestStatus(int status)
        +
        Set testing status flag
        +
        +
        Parameters:
        +
        status -
        +
        +
      • +
      + + + +
        +
      • +

        getTestStatus

        +
        public final int getTestStatus()
        +
        Get testing status flag
        +
        +
        Returns:
        +
        test status
        +
        +
      • +
      + + + +
        +
      • +

        getTestingMessage

        +
        public final java.lang.String getTestingMessage()
        +
        Get Node item status
        +
        +
        Returns:
        +
        Nodeitem testing status message as string
        +
        +
      • +
      + + + +
        +
      • +

        setLatency

        +
        public final void setLatency(long latency)
        +
        Set Nodeitem latency value in ms
        +
        +
        Parameters:
        +
        latency -
        +
        +
      • +
      + + + +
        +
      • +

        getLatency

        +
        public final long getLatency()
        +
        Get Nodeitem latency in ms
        +
        +
        Returns:
        +
        Latency value in ms
        +
        +
      • +
      + + + +
        +
      • +

        setTestLatency

        +
        public final void setTestLatency(long latency)
        +
        Set Nodeitem test latency value in ms
        +
        +
        Parameters:
        +
        latency -
        +
        +
      • +
      + + + +
        +
      • +

        getTestLatency

        +
        public final long getTestLatency()
        +
        Get Nodeitem test latency in ms
        +
        +
        Returns:
        +
        Latency value in ms
        +
        +
      • +
      + + + +
        +
      • +

        setFavouriteEnabled

        +
        public final void setFavouriteEnabled(boolean enabled)
        +
        Set exit enabled status of Nodeitem
        +
        +
        Parameters:
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        isFavourite

        +
        public final boolean isFavourite()
        +
        Get exit enabled status of Nodeitem
        +
        +
        Returns:
        +
        true if enabled
        +
        +
      • +
      + + + +
        +
      • +

        setGuardEnabled

        +
        public final void setGuardEnabled(boolean enabled)
        +
        Set guard enabled status of Nodeitem
        +
        +
        Parameters:
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        isGuardEnabled

        +
        public final boolean isGuardEnabled()
        +
        Get guard enabled status of Nodeitem
        +
        +
        Returns:
        +
        true if enabled
        +
        +
      • +
      + + + +
        +
      • +

        setStable

        +
        public final void setStable(java.lang.String stability)
        +
        Set Nodeitem stability yes/no/unknown
        +
        +
        Parameters:
        +
        stability -
        +
        +
      • +
      + + + +
        +
      • +

        getStability

        +
        public final java.lang.String getStability()
        +
        Get Nodeitem stability
        +
        +
        Returns:
        +
        Stability
        +
        +
      • +
      + + + +
        +
      • +

        setCountryCode

        +
        public final void setCountryCode(java.lang.String abrv)
        +
        Set Nodeitem with its two letter country code abbreviation
        +
        +
        Parameters:
        +
        abrv -
        +
        +
      • +
      + + + +
        +
      • +

        getCountryCode

        +
        public final java.lang.String getCountryCode()
        +
        Get nodeitem two letter country code abbreviation
        +
        +
        Returns:
        +
        Country code as string
        +
        +
      • +
      + + + +
        +
      • +

        setCountryName

        +
        public final void setCountryName(java.lang.String name)
        +
        Set Nodeitem with its full country name
        +
        +
        Parameters:
        +
        name -
        +
        +
      • +
      + + + +
        +
      • +

        getCountryName

        +
        public final java.lang.String getCountryName()
        +
        Get nodeitem full country name
        +
        +
        Returns:
        +
        Country name as string
        +
        +
      • +
      + + + +
        +
      • +

        setNickName

        +
        public final void setNickName(java.lang.String name)
        +
        Set nodeitem name
        +
        +
        Parameters:
        +
        name -
        +
        +
      • +
      + + + +
        +
      • +

        getNickName

        +
        public final java.lang.String getNickName()
        +
        Get nodeitem unique name
        +
        +
        Returns:
        +
        Node name as string
        +
        +
      • +
      + + + +
        +
      • +

        setBandwidth

        +
        public final void setBandwidth(float bw)
        +
        Set node item bandwidth
        +
        +
        Parameters:
        +
        bw -
        +
        +
      • +
      + + + +
        +
      • +

        getBandwidth

        +
        public final float getBandwidth()
        +
        Get nodeitem bandwith
        +
        +
        Returns:
        +
        Bandwidth as long, in kb/s
        +
        +
      • +
      + + + +
        +
      • +

        setStreams

        +
        public final void setStreams(int streams)
        +
        Set nodeitem number of streams
        +
        +
        Parameters:
        +
        streams -
        +
        +
      • +
      + + + +
        +
      • +

        getStreams

        +
        public final int getStreams()
        +
        Get nodeitems active streams
        +
        +
        Returns:
        +
        Number of active streams as int
        +
        +
      • +
      + + + +
        +
      • +

        setFingerprint

        +
        public final void setFingerprint(java.lang.String fp)
        +
        Set nodeitem fingerprint
        +
        +
        Parameters:
        +
        fp -
        +
        +
      • +
      + + + +
        +
      • +

        getFingerprint

        +
        public final java.lang.String getFingerprint()
        +
        Get nodeitems fingerprint
        +
        +
        Returns:
        +
        Tor node fingerprint as string
        +
        +
      • +
      + + + +
        +
      • +

        setIPAddress

        +
        public final void setIPAddress(java.lang.String ip)
        +
        Set nodeitem ip address
        +
        +
        Parameters:
        +
        ip -
        +
        +
      • +
      + + + +
        +
      • +

        getIPAddress

        +
        public final java.lang.String getIPAddress()
        +
        Get nodeitem ip address
        +
        +
        Returns:
        +
        IP address as a string
        +
        +
      • +
      + + + +
        +
      • +

        clone

        +
        public NodeItem clone()
        +
        +
        Overrides:
        +
        clone in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/NodeList.html b/javadoc/client/NodeList.html new file mode 100644 index 0000000..04244cf --- /dev/null +++ b/javadoc/client/NodeList.html @@ -0,0 +1,804 @@ + + + + + + +NodeList (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class NodeList

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • client.NodeList
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class NodeList
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      NodeList(java.lang.String filepath, + java.lang.String exitfavourites, + java.lang.String guardfavouritesfile) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddBridge(java.lang.String bridgedata) +
      Add newly learned bridge to nodelist
      +
      voidclearBridges() +
      Clear any learned bridges
      +
      java.lang.StringfilterRouterInfo(java.util.ArrayList<java.lang.String> alInfo, + java.lang.String field) 
      intgetCurrentStatus() +
      Get the process status
      +
      java.util.ArrayList<java.lang.String>getExitNodes(boolean all, + boolean omitfailednodes) +
      Get a list of exitnodes, if all is false then it returns only favourited + nodes, if omitfailednodes is true then don't include nodes that failed + testing
      +
      java.lang.StringgetExitNodesAsString(boolean all, + boolean omitfailednodes) +
      Get a string of comma separated exitnodes, if all is false then it + returns only favourited nodes, if omitfailednodes is true then don't + include nodes that failed testing
      +
      java.lang.StringgetGuardFavouritesAsCSV() +
      Get guard favourites
      +
      java.util.ArrayList<java.lang.String>getGuardNodes() +
      Get a list of all guard nodes guard nodes
      +
      NodeItemgetNode(java.lang.String key) +
      Get node item from its fingerprint
      +
      intgetNumberOfFavs() +
      Get the number of active favourites
      +
      java.util.ArrayList<java.lang.String>getRouterDesc(java.lang.String finger) 
      java.util.ArrayList<java.lang.String>getRouterStatus(java.lang.String finger) 
      java.lang.String[]getValidatedCountries() +
      Gets validated countries, a valid country is any country with active exit + nodes
      +
      java.lang.String[]getValidatedCountryCodes() +
      Gets validated country codes, a valid country is any country with active + exit nodes
      +
      voidrefreshExitTableModel(java.lang.String isocountry) +
      Update the table model based on supplied country
      +
      voidrefreshGuardTableModel() +
      Update the guard node table model
      +
      voidrefreshNodelist(TorController tc) +
      Generate the nodelist
      +
      voidsaveExitFavourites() +
      Save exit node whitelist
      +
      intsaveGuardWhitelist() +
      Save exit node blacklist
      +
      voidsetExitNodeTableModel(ExitNodeTableModel entm) +
      Set the exit node view table model
      +
      voidsetGuardNodeTableModel(GuardNodeTableModel gntm) +
      Set the guard node view table model
      +
      voidterminate() +
      Ensures any threaded actions will terminate themselves
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        NodeList

        +
        public NodeList(java.lang.String filepath,
        +                java.lang.String exitfavourites,
        +                java.lang.String guardfavouritesfile)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getNode

        +
        public final NodeItem getNode(java.lang.String key)
        +
        Get node item from its fingerprint
        +
        +
        Parameters:
        +
        key - or fingerprint
        +
        Returns:
        +
        NodeItem
        +
        +
      • +
      + + + +
        +
      • +

        getRouterDesc

        +
        public java.util.ArrayList<java.lang.String> getRouterDesc(java.lang.String finger)
        +
      • +
      + + + +
        +
      • +

        getRouterStatus

        +
        public java.util.ArrayList<java.lang.String> getRouterStatus(java.lang.String finger)
        +
      • +
      + + + +
        +
      • +

        filterRouterInfo

        +
        public java.lang.String filterRouterInfo(java.util.ArrayList<java.lang.String> alInfo,
        +                                         java.lang.String field)
        +
      • +
      + + + +
        +
      • +

        getCurrentStatus

        +
        public final int getCurrentStatus()
        +
        Get the process status
        +
        +
        Returns:
        +
        status
        +
        +
      • +
      + + + +
        +
      • +

        refreshNodelist

        +
        public final void refreshNodelist(TorController tc)
        +
        Generate the nodelist
        +
        +
        Parameters:
        +
        tc -
        +
        +
      • +
      + + + +
        +
      • +

        addBridge

        +
        public void addBridge(java.lang.String bridgedata)
        +
        Add newly learned bridge to nodelist
        +
        +
        Parameters:
        +
        bridgedata -
        +
        +
      • +
      + + + +
        +
      • +

        clearBridges

        +
        public void clearBridges()
        +
        Clear any learned bridges
        +
      • +
      + + + +
        +
      • +

        getValidatedCountries

        +
        public final java.lang.String[] getValidatedCountries()
        +
        Gets validated countries, a valid country is any country with active exit + nodes
        +
        +
        Returns:
        +
        String array of countries
        +
        +
      • +
      + + + +
        +
      • +

        getValidatedCountryCodes

        +
        public final java.lang.String[] getValidatedCountryCodes()
        +
        Gets validated country codes, a valid country is any country with active + exit nodes
        +
        +
        Returns:
        +
        String array of country abbreviations
        +
        +
      • +
      + + + +
        +
      • +

        setGuardNodeTableModel

        +
        public final void setGuardNodeTableModel(GuardNodeTableModel gntm)
        +
        Set the guard node view table model
        +
        +
        Parameters:
        +
        gntm -
        +
        +
      • +
      + + + +
        +
      • +

        setExitNodeTableModel

        +
        public final void setExitNodeTableModel(ExitNodeTableModel entm)
        +
        Set the exit node view table model
        +
        +
        Parameters:
        +
        entm -
        +
        +
      • +
      + + + +
        +
      • +

        getExitNodes

        +
        public final java.util.ArrayList<java.lang.String> getExitNodes(boolean all,
        +                                                                boolean omitfailednodes)
        +
        Get a list of exitnodes, if all is false then it returns only favourited + nodes, if omitfailednodes is true then don't include nodes that failed + testing
        +
        +
        Parameters:
        +
        all -
        +
        omitfailednodes -
        +
        Returns:
        +
        ArrayList of exit nodes
        +
        +
      • +
      + + + +
        +
      • +

        getExitNodesAsString

        +
        public final java.lang.String getExitNodesAsString(boolean all,
        +                                                   boolean omitfailednodes)
        +
        Get a string of comma separated exitnodes, if all is false then it + returns only favourited nodes, if omitfailednodes is true then don't + include nodes that failed testing
        +
        +
        Parameters:
        +
        all -
        +
        omitfailednodes -
        +
        Returns:
        +
        String of exitnodes in csv format
        +
        +
      • +
      + + + +
        +
      • +

        getGuardNodes

        +
        public final java.util.ArrayList<java.lang.String> getGuardNodes()
        +
        Get a list of all guard nodes guard nodes
        +
        +
        Returns:
        +
        ArrayList of guard nodes
        +
        +
      • +
      + + + +
        +
      • +

        getGuardFavouritesAsCSV

        +
        public final java.lang.String getGuardFavouritesAsCSV()
        +
        Get guard favourites
        +
        +
        Returns:
        +
        CSV string of guard entry fingerprints
        +
        +
      • +
      + + + +
        +
      • +

        refreshGuardTableModel

        +
        public final void refreshGuardTableModel()
        +
        Update the guard node table model
        +
      • +
      + + + +
        +
      • +

        refreshExitTableModel

        +
        public final void refreshExitTableModel(java.lang.String isocountry)
        +
        Update the table model based on supplied country
        +
        +
        Parameters:
        +
        isocountry - in the format "GB,Great Britain"
        +
        +
      • +
      + + + +
        +
      • +

        getNumberOfFavs

        +
        public int getNumberOfFavs()
        +
        Get the number of active favourites
        +
        +
        Returns:
        +
        number of favs as int
        +
        +
      • +
      + + + +
        +
      • +

        terminate

        +
        public final void terminate()
        +
        Ensures any threaded actions will terminate themselves
        +
      • +
      + + + +
        +
      • +

        saveExitFavourites

        +
        public void saveExitFavourites()
        +
        Save exit node whitelist
        +
      • +
      + + + +
        +
      • +

        saveGuardWhitelist

        +
        public int saveGuardWhitelist()
        +
        Save exit node blacklist
        +
        +
        Returns:
        +
        number of active guards
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/PacFactory.html b/javadoc/client/PacFactory.html new file mode 100644 index 0000000..2883901 --- /dev/null +++ b/javadoc/client/PacFactory.html @@ -0,0 +1,903 @@ + + + + + + +PacFactory (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class PacFactory

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • client.PacFactory
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class PacFactory
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      PacFactory() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddDirectMatchingRule(java.util.ArrayList<java.lang.String> rules, + java.lang.String pattern) 
      voidaddProxyRule(java.util.ArrayList<java.lang.String> rules, + java.lang.String proxy) 
      voidaddSocksMatchingRule(java.util.ArrayList<java.lang.String> rules, + java.lang.String pattern, + java.lang.String host, + java.lang.String port) +
      Add socks pattern mayching rule to a supllied list
      +
      voidaddSocksRule(java.util.ArrayList<java.lang.String> rules, + java.lang.String host, + java.lang.String port) +
      Add a socks rule to a supplied list
      +
      voidaddToPatternFile(java.lang.String country, + java.lang.String description, + java.lang.String pattern) +
      Adds pattern to an existing pattern file
      +
      voidbackupProxyPrefs() +
      Generic backup of proxy settings
      +
      voidcreatePacFile(java.lang.String isocountry, + int port) +
      Create and/or activate a pacfile for a specific country
      +
      voiddeleteAllPAC() +
      Delete all pac files
      +
      booleandeletePAC(java.lang.String filename) +
      Delete specified pac file
      +
      voiddeletePatternsFile(java.lang.String country, + java.lang.String type) +
      Delete patterns file for a given country and type, where type is either + "def" or "user"
      +
      voiddeleteProxyPrefs() +
      Generic proxy prefs delete, for ease of use
      +
      voidexportUserPatterns(java.lang.String filename, + java.io.File[] files) +
      Export user patterns
      +
      java.lang.StringgetActiveCountry() +
      Get the active country code
      +
      java.lang.StringgetDoNotProxy() +
      Get value of comma separated host or ip list
      +
      java.io.File[]getPatternsFiles() +
      Get an array of user pattern files
      +
      booleanimportPatterns(java.lang.String filename) +
      Import patterns
      +
      voidloadPatternsList(java.lang.String country, + java.util.ArrayList<java.lang.String> list) +
      Load a patterns list from a file
      +
      voidrestoreProxyPrefs(boolean resetonfail) +
      Generic restore of proxy settings, for ease of use
      +
      voidsavePatternsList(java.lang.String country, + java.lang.String type, + java.util.ArrayList<java.lang.String> list) +
      Save a patterns list by filename
      +
      voidsetBackupFolder(java.lang.String folder) +
      Set folder where system proxy settings will be backed up
      +
      voidsetDefaultProxy(java.lang.String proxyurl) +
      Set default proxy url
      +
      voidsetDoNotProxy(java.lang.String hostcsv) +
      Set do not proxy
      +
      voidsetPACFolder(java.lang.String folder) +
      Set folder where pac files will be generated
      +
      voidsetPatternsFolder(java.lang.String folder) +
      Create folder in which pattern files will be stored
      +
      voidsetProxyAutoConfigURL(java.lang.String url) +
      Generic set proxy config
      +
      voidsetTempFolder(java.lang.String path) +
      Set the temp folder for file extractions
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PacFactory

        +
        public PacFactory()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getActiveCountry

        +
        public java.lang.String getActiveCountry()
        +
        Get the active country code
        +
        +
        Returns:
        +
        Active country
        +
        +
      • +
      + + + +
        +
      • +

        createPacFile

        +
        public void createPacFile(java.lang.String isocountry,
        +                          int port)
        +
        Create and/or activate a pacfile for a specific country
        +
        +
        Parameters:
        +
        isocountry -
        +
        port -
        +
        +
      • +
      + + + +
        +
      • +

        addProxyRule

        +
        public void addProxyRule(java.util.ArrayList<java.lang.String> rules,
        +                         java.lang.String proxy)
        +
        +
        Parameters:
        +
        rules -
        +
        proxy -
        +
        +
      • +
      + + + +
        +
      • +

        addSocksRule

        +
        public void addSocksRule(java.util.ArrayList<java.lang.String> rules,
        +                         java.lang.String host,
        +                         java.lang.String port)
        +
        Add a socks rule to a supplied list
        +
        +
        Parameters:
        +
        rules -
        +
        host -
        +
        port -
        +
        +
      • +
      + + + +
        +
      • +

        addDirectMatchingRule

        +
        public void addDirectMatchingRule(java.util.ArrayList<java.lang.String> rules,
        +                                  java.lang.String pattern)
        +
        +
        Parameters:
        +
        rules -
        +
        pattern -
        +
        +
      • +
      + + + +
        +
      • +

        addSocksMatchingRule

        +
        public void addSocksMatchingRule(java.util.ArrayList<java.lang.String> rules,
        +                                 java.lang.String pattern,
        +                                 java.lang.String host,
        +                                 java.lang.String port)
        +
        Add socks pattern mayching rule to a supllied list
        +
        +
        Parameters:
        +
        rules -
        +
        pattern -
        +
        host -
        +
        port -
        +
        +
      • +
      + + + +
        +
      • +

        loadPatternsList

        +
        public void loadPatternsList(java.lang.String country,
        +                             java.util.ArrayList<java.lang.String> list)
        +
        Load a patterns list from a file
        +
        +
        Parameters:
        +
        country -
        +
        list -
        +
        +
      • +
      + + + +
        +
      • +

        deletePatternsFile

        +
        public void deletePatternsFile(java.lang.String country,
        +                               java.lang.String type)
        +
        Delete patterns file for a given country and type, where type is either + "def" or "user"
        +
        +
        Parameters:
        +
        country -
        +
        type -
        +
        +
      • +
      + + + +
        +
      • +

        savePatternsList

        +
        public void savePatternsList(java.lang.String country,
        +                             java.lang.String type,
        +                             java.util.ArrayList<java.lang.String> list)
        +
        Save a patterns list by filename
        +
        +
        Parameters:
        +
        country -
        +
        list -
        +
        type -
        +
        +
      • +
      + + + +
        +
      • +

        setPatternsFolder

        +
        public final void setPatternsFolder(java.lang.String folder)
        +
        Create folder in which pattern files will be stored
        +
        +
        Parameters:
        +
        folder -
        +
        +
      • +
      + + + +
        +
      • +

        setPACFolder

        +
        public final void setPACFolder(java.lang.String folder)
        +
        Set folder where pac files will be generated
        +
        +
        Parameters:
        +
        folder -
        +
        +
      • +
      + + + +
        +
      • +

        setBackupFolder

        +
        public final void setBackupFolder(java.lang.String folder)
        +
        Set folder where system proxy settings will be backed up
        +
        +
        Parameters:
        +
        folder -
        +
        +
      • +
      + + + +
        +
      • +

        setTempFolder

        +
        public final void setTempFolder(java.lang.String path)
        +
        Set the temp folder for file extractions
        +
        +
        Parameters:
        +
        path -
        +
        +
      • +
      + + + +
        +
      • +

        backupProxyPrefs

        +
        public void backupProxyPrefs()
        +
        Generic backup of proxy settings
        +
      • +
      + + + +
        +
      • +

        restoreProxyPrefs

        +
        public void restoreProxyPrefs(boolean resetonfail)
        +
        Generic restore of proxy settings, for ease of use
        +
      • +
      + + + +
        +
      • +

        deleteProxyPrefs

        +
        public void deleteProxyPrefs()
        +
        Generic proxy prefs delete, for ease of use
        +
      • +
      + + + +
        +
      • +

        setProxyAutoConfigURL

        +
        public void setProxyAutoConfigURL(java.lang.String url)
        +
        Generic set proxy config
        +
        +
        Parameters:
        +
        url -
        +
        +
      • +
      + + + +
        +
      • +

        deletePAC

        +
        public boolean deletePAC(java.lang.String filename)
        +
        Delete specified pac file
        +
        +
        Parameters:
        +
        filename -
        +
        Returns:
        +
        boolean true if action successful
        +
        +
      • +
      + + + +
        +
      • +

        deleteAllPAC

        +
        public void deleteAllPAC()
        +
        Delete all pac files
        +
      • +
      + + + +
        +
      • +

        setDefaultProxy

        +
        public void setDefaultProxy(java.lang.String proxyurl)
        +
        Set default proxy url
        +
        +
        Parameters:
        +
        proxyurl -
        +
        +
      • +
      + + + +
        +
      • +

        setDoNotProxy

        +
        public void setDoNotProxy(java.lang.String hostcsv)
        +
        Set do not proxy
        +
        +
        Parameters:
        +
        hostcsv -
        +
        +
      • +
      + + + +
        +
      • +

        getDoNotProxy

        +
        public java.lang.String getDoNotProxy()
        +
        Get value of comma separated host or ip list
        +
        +
        Returns:
        +
        String value
        +
        +
      • +
      + + + +
        +
      • +

        addToPatternFile

        +
        public void addToPatternFile(java.lang.String country,
        +                             java.lang.String description,
        +                             java.lang.String pattern)
        +
        Adds pattern to an existing pattern file
        +
        +
        Parameters:
        +
        country -
        +
        description -
        +
        pattern -
        +
        +
      • +
      + + + +
        +
      • +

        getPatternsFiles

        +
        public java.io.File[] getPatternsFiles()
        +
        Get an array of user pattern files
        +
        +
        Returns:
        +
        array of files
        +
        +
      • +
      + + + +
        +
      • +

        exportUserPatterns

        +
        public void exportUserPatterns(java.lang.String filename,
        +                               java.io.File[] files)
        +
        Export user patterns
        +
        +
        Parameters:
        +
        filename -
        +
        files -
        +
        +
      • +
      + + + +
        +
      • +

        importPatterns

        +
        public boolean importPatterns(java.lang.String filename)
        +
        Import patterns
        +
        +
        Parameters:
        +
        filename -
        +
        Returns:
        +
        true if succesful
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/PatternsEditor.CustomTableCellRenderer.html b/javadoc/client/PatternsEditor.CustomTableCellRenderer.html new file mode 100644 index 0000000..e0978a2 --- /dev/null +++ b/javadoc/client/PatternsEditor.CustomTableCellRenderer.html @@ -0,0 +1,454 @@ + + + + + + +PatternsEditor.CustomTableCellRenderer (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class PatternsEditor.CustomTableCellRenderer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • javax.swing.JComponent
        • +
        • +
            +
          • javax.swing.JLabel
          • +
          • +
              +
            • javax.swing.table.DefaultTableCellRenderer
            • +
            • +
                +
              • client.PatternsEditor.CustomTableCellRenderer
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants, javax.swing.table.TableCellRenderer
    +
    +
    +
    Enclosing class:
    +
    PatternsEditor
    +
    +
    +
    +
    public class PatternsEditor.CustomTableCellRenderer
    +extends javax.swing.table.DefaultTableCellRenderer
    +
    CustomTableCellRenderer
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.table.DefaultTableCellRenderer

        +javax.swing.table.DefaultTableCellRenderer.UIResource
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JLabel

        +javax.swing.JLabel.AccessibleJLabel
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JComponent

        +javax.swing.JComponent.AccessibleJComponent
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javax.swing.table.DefaultTableCellRenderer

        +noFocusBorder
      • +
      +
        +
      • + + +

        Fields inherited from class javax.swing.JLabel

        +labelFor
      • +
      +
        +
      • + + +

        Fields inherited from class javax.swing.JComponent

        +listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface javax.swing.SwingConstants

        +BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.awt.ComponentgetTableCellRendererComponent(javax.swing.JTable table, + java.lang.Object value, + boolean isSelected, + boolean hasFocus, + int row, + int column) 
      +
        +
      • + + +

        Methods inherited from class javax.swing.table.DefaultTableCellRenderer

        +firePropertyChange, firePropertyChange, invalidate, isOpaque, repaint, repaint, repaint, revalidate, setBackground, setForeground, setValue, updateUI, validate
      • +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JLabel

        +checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition
      • +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JComponent

        +addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CustomTableCellRenderer

        +
        public CustomTableCellRenderer()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getTableCellRendererComponent

        +
        public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
        +                                                        java.lang.Object value,
        +                                                        boolean isSelected,
        +                                                        boolean hasFocus,
        +                                                        int row,
        +                                                        int column)
        +
        +
        Specified by:
        +
        getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer
        +
        Overrides:
        +
        getTableCellRendererComponent in class javax.swing.table.DefaultTableCellRenderer
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/PatternsEditor.PACTableModel.html b/javadoc/client/PatternsEditor.PACTableModel.html new file mode 100644 index 0000000..115eaa1 --- /dev/null +++ b/javadoc/client/PatternsEditor.PACTableModel.html @@ -0,0 +1,486 @@ + + + + + + +PatternsEditor.PACTableModel (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class PatternsEditor.PACTableModel

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.swing.table.AbstractTableModel
    • +
    • +
        +
      • javax.swing.table.DefaultTableModel
      • +
      • +
          +
        • client.PatternsEditor.PACTableModel
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, javax.swing.table.TableModel
    +
    +
    +
    Enclosing class:
    +
    PatternsEditor
    +
    +
    +
    +
    public class PatternsEditor.PACTableModel
    +extends javax.swing.table.DefaultTableModel
    +
    PACTableModel class
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javax.swing.table.DefaultTableModel

        +columnIdentifiers, dataVector
      • +
      +
        +
      • + + +

        Fields inherited from class javax.swing.table.AbstractTableModel

        +listenerList
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      PACTableModel() +
      Constructor
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddRow(java.lang.Object[] obj, + boolean editable) 
      java.lang.ClassgetColumnClass(int columnIndex) +
      Get column class
      +
      intgetColumnCount() +
      Get column count as integer
      +
      java.lang.StringgetColumnName(int index) +
      Get column name at given index
      +
      booleanisCellEditable(int row, + int column) +
      Test if cell at given row, col is editable
      +
      voidsetColumnName(java.lang.String name, + int index) +
      Set the column name at the specified index
      +
      java.lang.StringtoString() +
      Returns all data as a single string
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.table.DefaultTableModel

        +addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
      • +
      +
        +
      • + + +

        Methods inherited from class javax.swing.table.AbstractTableModel

        +addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PACTableModel

        +
        public PACTableModel()
        +
        Constructor
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        addRow

        +
        public void addRow(java.lang.Object[] obj,
        +                   boolean editable)
        +
      • +
      + + + +
        +
      • +

        getColumnCount

        +
        public int getColumnCount()
        +
        Get column count as integer
        +
        +
        Specified by:
        +
        getColumnCount in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getColumnCount in class javax.swing.table.DefaultTableModel
        +
        Returns:
        +
        columns as integer
        +
        +
      • +
      + + + +
        +
      • +

        getColumnClass

        +
        public java.lang.Class getColumnClass(int columnIndex)
        +
        Get column class
        +
        +
        Specified by:
        +
        getColumnClass in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getColumnClass in class javax.swing.table.AbstractTableModel
        +
        Parameters:
        +
        columnIndex -
        +
        Returns:
        +
        object Class
        +
        +
      • +
      + + + +
        +
      • +

        isCellEditable

        +
        public boolean isCellEditable(int row,
        +                              int column)
        +
        Test if cell at given row, col is editable
        +
        +
        Specified by:
        +
        isCellEditable in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        isCellEditable in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        row -
        +
        column -
        +
        Returns:
        +
        True if editable
        +
        +
      • +
      + + + +
        +
      • +

        getColumnName

        +
        public java.lang.String getColumnName(int index)
        +
        Get column name at given index
        +
        +
        Specified by:
        +
        getColumnName in interface javax.swing.table.TableModel
        +
        Overrides:
        +
        getColumnName in class javax.swing.table.DefaultTableModel
        +
        Parameters:
        +
        index -
        +
        Returns:
        +
        name as string
        +
        +
      • +
      + + + +
        +
      • +

        setColumnName

        +
        public void setColumnName(java.lang.String name,
        +                          int index)
        +
        Set the column name at the specified index
        +
        +
        Parameters:
        +
        name -
        +
        index -
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        Returns all data as a single string
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        Returns:
        +
        string
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/PatternsEditor.html b/javadoc/client/PatternsEditor.html new file mode 100644 index 0000000..59b597f --- /dev/null +++ b/javadoc/client/PatternsEditor.html @@ -0,0 +1,553 @@ + + + + + + +PatternsEditor (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class PatternsEditor

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • java.awt.Window
        • +
        • +
            +
          • java.awt.Dialog
          • +
          • +
              +
            • javax.swing.JDialog
            • +
            • +
                +
              • client.PatternsEditor
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    +
    +
    +
    +
    public final class PatternsEditor
    +extends javax.swing.JDialog
    +
    +
    Author:
    +
    Alistair Neil,
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      class PatternsEditor.CustomTableCellRenderer +
      CustomTableCellRenderer
      +
      class PatternsEditor.PACTableModel +
      PACTableModel class
      +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JDialog

        +javax.swing.JDialog.AccessibleJDialog
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Dialog

        +java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Window

        +java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static intAPPLY 
      static intCANCEL 
      +
        +
      • + + +

        Fields inherited from class javax.swing.JDialog

        +accessibleContext, rootPane, rootPaneCheckingEnabled
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Dialog

        +DEFAULT_MODALITY_TYPE
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface javax.swing.WindowConstants

        +DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      PatternsEditor(java.awt.Frame parent, + boolean modal, + PacFactory pacfactory) +
      Creates a PatternsEditor dialog
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      intgetReturnStatus() 
      voidpopulateCountryComboBox(java.lang.String[] countries) +
      Populate the country combobox with a list of countries
      +
      voidsetSelectedCountry(java.lang.String country) +
      Set the selected country
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JDialog

        +addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Dialog

        +addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Window

        +addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PatternsEditor

        +
        public PatternsEditor(java.awt.Frame parent,
        +                      boolean modal,
        +                      PacFactory pacfactory)
        +
        Creates a PatternsEditor dialog
        +
        +
        Parameters:
        +
        parent - Parent frame
        +
        modal - Modality
        +
        pacfactory - PacFactory being edited
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        populateCountryComboBox

        +
        public void populateCountryComboBox(java.lang.String[] countries)
        +
        Populate the country combobox with a list of countries
        +
        +
        Parameters:
        +
        countries - String[] of countries
        +
        +
      • +
      + + + +
        +
      • +

        setSelectedCountry

        +
        public void setSelectedCountry(java.lang.String country)
        +
        Set the selected country
        +
        +
        Parameters:
        +
        country -
        +
        +
      • +
      + + + +
        +
      • +

        getReturnStatus

        +
        public int getReturnStatus()
        +
        +
        Returns:
        +
        the return status of this dialog - one of RET_OK or RET_CANCEL
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/PrefsDialog.html b/javadoc/client/PrefsDialog.html new file mode 100644 index 0000000..aaa9477 --- /dev/null +++ b/javadoc/client/PrefsDialog.html @@ -0,0 +1,560 @@ + + + + + + +PrefsDialog (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class PrefsDialog

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • java.awt.Window
        • +
        • +
            +
          • java.awt.Dialog
          • +
          • +
              +
            • javax.swing.JDialog
            • +
            • +
                +
              • client.PrefsDialog
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    +
    +
    +
    +
    public final class PrefsDialog
    +extends javax.swing.JDialog
    +
    +
    Author:
    +
    Alistair Neil,
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JDialog

        +javax.swing.JDialog.AccessibleJDialog
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Dialog

        +java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Window

        +java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static intAPPLY 
      static intCANCEL 
      static intRESET 
      +
        +
      • + + +

        Fields inherited from class javax.swing.JDialog

        +accessibleContext, rootPane, rootPaneCheckingEnabled
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Dialog

        +DEFAULT_MODALITY_TYPE
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface javax.swing.WindowConstants

        +DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      PrefsDialog(java.awt.Frame parent, + SimpleProps sp, + java.lang.String disabledprefs) +
      Creates a preferences editor dialog
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      intgetReturnStatus() 
      voidloadAdvancedPrefs(boolean usedefault) +
      Load the preferences
      +
      voidloadBasicPrefs(boolean usedefault) 
      voidsavePreferences() +
      Save preferences
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JDialog

        +addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Dialog

        +addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Window

        +addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        PrefsDialog

        +
        public PrefsDialog(java.awt.Frame parent,
        +                   SimpleProps sp,
        +                   java.lang.String disabledprefs)
        +
        Creates a preferences editor dialog
        +
        +
        Parameters:
        +
        parent - Parent Frame
        +
        sp -
        +
        disabledprefs -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getReturnStatus

        +
        public int getReturnStatus()
        +
        +
        Returns:
        +
        the return status of this dialog - one of RET_OK or RET_CANCEL
        +
        +
      • +
      + + + +
        +
      • +

        loadBasicPrefs

        +
        public void loadBasicPrefs(boolean usedefault)
        +
      • +
      + + + +
        +
      • +

        loadAdvancedPrefs

        +
        public void loadAdvancedPrefs(boolean usedefault)
        +
        Load the preferences
        +
        +
        Parameters:
        +
        usedefault -
        +
        +
      • +
      + + + +
        +
      • +

        savePreferences

        +
        public void savePreferences()
        +
        Save preferences
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/QuickAddDialog.html b/javadoc/client/QuickAddDialog.html new file mode 100644 index 0000000..330d51e --- /dev/null +++ b/javadoc/client/QuickAddDialog.html @@ -0,0 +1,591 @@ + + + + + + +QuickAddDialog (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class QuickAddDialog

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • java.awt.Window
        • +
        • +
            +
          • java.awt.Dialog
          • +
          • +
              +
            • javax.swing.JDialog
            • +
            • +
                +
              • client.QuickAddDialog
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    +
    +
    +
    +
    public final class QuickAddDialog
    +extends javax.swing.JDialog
    +
    +
    Author:
    +
    Alistair Neil,
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JDialog

        +javax.swing.JDialog.AccessibleJDialog
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Dialog

        +java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Window

        +java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static intAPPLY 
      static intCANCEL 
      static intRESET 
      +
        +
      • + + +

        Fields inherited from class javax.swing.JDialog

        +accessibleContext, rootPane, rootPaneCheckingEnabled
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Dialog

        +DEFAULT_MODALITY_TYPE
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface javax.swing.WindowConstants

        +DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      QuickAddDialog(java.awt.Frame parent, + boolean modal) +
      Creates a quick add patterns dialog
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringgetDescription() +
      Get contents of description field
      +
      java.lang.StringgetPattern() +
      Get contents of the pattern field
      +
      intgetReturnStatus() 
      voidsetApplyText(java.lang.String text) +
      Set text that appears on the Apply button
      +
      voidsetFields(java.lang.String desc, + java.lang.String pattern) +
      Set the test that appears in both fields
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JDialog

        +addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Dialog

        +addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Window

        +addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        QuickAddDialog

        +
        public QuickAddDialog(java.awt.Frame parent,
        +                      boolean modal)
        +
        Creates a quick add patterns dialog
        +
        +
        Parameters:
        +
        parent - parent frame
        +
        modal - modality
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setApplyText

        +
        public void setApplyText(java.lang.String text)
        +
        Set text that appears on the Apply button
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        setFields

        +
        public void setFields(java.lang.String desc,
        +                      java.lang.String pattern)
        +
        Set the test that appears in both fields
        +
        +
        Parameters:
        +
        desc -
        +
        pattern -
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        public java.lang.String getDescription()
        +
        Get contents of description field
        +
        +
        Returns:
        +
        String text
        +
        +
      • +
      + + + +
        +
      • +

        getPattern

        +
        public java.lang.String getPattern()
        +
        Get contents of the pattern field
        +
        +
        Returns:
        +
        String text
        +
        +
      • +
      + + + +
        +
      • +

        getReturnStatus

        +
        public int getReturnStatus()
        +
        +
        Returns:
        +
        the return status of this dialog - one of RET_OK or RET_CANCEL
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/SelekTOR.html b/javadoc/client/SelekTOR.html new file mode 100644 index 0000000..2135bd1 --- /dev/null +++ b/javadoc/client/SelekTOR.html @@ -0,0 +1,445 @@ + + + + + + +SelekTOR (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class SelekTOR

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • java.awt.Window
        • +
        • +
            +
          • java.awt.Frame
          • +
          • +
              +
            • javax.swing.JFrame
            • +
            • +
                +
              • client.SelekTOR
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    +
    +
    +
    +
    public class SelekTOR
    +extends javax.swing.JFrame
    +
    +
    Author:
    +
    Alistair Neil
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JFrame

        +javax.swing.JFrame.AccessibleJFrame
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Frame

        +java.awt.Frame.AccessibleAWTFrame
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Window

        +java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javax.swing.JFrame

        +accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Frame

        +CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface javax.swing.WindowConstants

        +DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      SelekTOR(java.lang.String[] args) +
      Initialises SelekTOR UI Frame
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidcleanupExit() +
      The main application exit routine also does cleanup before exiting
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JFrame

        +addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Frame

        +addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Window

        +addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
        +
      • + + +

        Methods inherited from interface java.awt.MenuContainer

        +getFont, postEvent
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SelekTOR

        +
        public SelekTOR(java.lang.String[] args)
        +
        Initialises SelekTOR UI Frame
        +
        +
        Parameters:
        +
        args -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        cleanupExit

        +
        public final void cleanupExit()
        +
        The main application exit routine also does cleanup before exiting
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/TorCircuit.html b/javadoc/client/TorCircuit.html new file mode 100644 index 0000000..cd795e8 --- /dev/null +++ b/javadoc/client/TorCircuit.html @@ -0,0 +1,677 @@ + + + + + + +TorCircuit (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class TorCircuit

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • client.TorCircuit
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class TorCircuit
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static intFINGER 
      static intNICKNAME 
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      TorCircuit() +
      Constructor
      +
      TorCircuit(java.lang.String circuit) +
      Constructor, Create circuit object with given circuit
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringgetBuildFlags() +
      Get current circuits build flags
      +
      java.lang.StringgetCircuit() +
      Get circuit
      +
      java.lang.StringgetExit(int type) +
      Get Exitnode
      +
      java.lang.StringgetExitHop() +
      Get current circuits exit node
      +
      static java.lang.StringgetFromNodeHop(java.lang.String nodeinfo, + int type) +
      Get fingerprint of given node Nodeinfo is in the format of + fingerprint~name or fingerprint=name
      +
      java.lang.StringgetGuard(int type) +
      Get Guardnode finger or nick
      +
      java.lang.StringgetGuardHop() +
      Get current circuits guard or entry node
      +
      java.lang.StringgetHops() +
      Get circuit hops
      +
      java.lang.StringgetID() +
      Get current circuit ID
      +
      java.lang.StringgetMiddleHop() +
      Get current circuits middle node if any, returns exit node for a two hop + circuit
      +
      java.lang.StringgetMiddleMan(int type) +
      Get Middleman
      +
      java.lang.StringgetPurpose() +
      Get current circuits purpose
      +
      java.lang.StringgetStatus() +
      Get current circuit status
      +
      java.lang.StringgetTimestamp() +
      Get current circuits timestamp
      +
      voidsetCircuit(java.lang.String circuit) +
      Set circuit to supplied circuit
      +
      voidsetHops(java.lang.String hops) +
      Set hops
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TorCircuit

        +
        public TorCircuit()
        +
        Constructor
        +
      • +
      + + + +
        +
      • +

        TorCircuit

        +
        public TorCircuit(java.lang.String circuit)
        +
        Constructor, Create circuit object with given circuit
        +
        +
        Parameters:
        +
        circuit -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setCircuit

        +
        public void setCircuit(java.lang.String circuit)
        +
        Set circuit to supplied circuit
        +
        +
        Parameters:
        +
        circuit -
        +
        +
      • +
      + + + +
        +
      • +

        getCircuit

        +
        public java.lang.String getCircuit()
        +
        Get circuit
        +
        +
        Returns:
        +
        circuit as string
        +
        +
      • +
      + + + +
        +
      • +

        setHops

        +
        public void setHops(java.lang.String hops)
        +
        Set hops
        +
        +
        Parameters:
        +
        hops -
        +
        +
      • +
      + + + +
        +
      • +

        getID

        +
        public java.lang.String getID()
        +
        Get current circuit ID
        +
        +
        Returns:
        +
        ID as string
        +
        +
      • +
      + + + +
        +
      • +

        getStatus

        +
        public java.lang.String getStatus()
        +
        Get current circuit status
        +
        +
        Returns:
        +
        status as string
        +
        +
      • +
      + + + +
        +
      • +

        getBuildFlags

        +
        public java.lang.String getBuildFlags()
        +
        Get current circuits build flags
        +
        +
        Returns:
        +
        build flags as string
        +
        +
      • +
      + + + +
        +
      • +

        getPurpose

        +
        public java.lang.String getPurpose()
        +
        Get current circuits purpose
        +
        +
        Returns:
        +
        purpose as string
        +
        +
      • +
      + + + +
        +
      • +

        getTimestamp

        +
        public java.lang.String getTimestamp()
        +
        Get current circuits timestamp
        +
        +
        Returns:
        +
        timestamp as string
        +
        +
      • +
      + + + +
        +
      • +

        getHops

        +
        public java.lang.String getHops()
        +
        Get circuit hops
        +
        +
        Returns:
        +
        circuit hops as string
        +
        +
      • +
      + + + +
        +
      • +

        getGuardHop

        +
        public java.lang.String getGuardHop()
        +
        Get current circuits guard or entry node
        +
        +
        Returns:
        +
        guard node as string
        +
        +
      • +
      + + + +
        +
      • +

        getMiddleHop

        +
        public java.lang.String getMiddleHop()
        +
        Get current circuits middle node if any, returns exit node for a two hop + circuit
        +
        +
        Returns:
        +
        middleman node as string
        +
        +
      • +
      + + + +
        +
      • +

        getExitHop

        +
        public java.lang.String getExitHop()
        +
        Get current circuits exit node
        +
        +
        Returns:
        +
        exit node as string
        +
        +
      • +
      + + + +
        +
      • +

        getGuard

        +
        public java.lang.String getGuard(int type)
        +
        Get Guardnode finger or nick
        +
        +
        Parameters:
        +
        type - 0 = finger, 1 = nick
        +
        Returns:
        +
        fingerprint as string
        +
        +
      • +
      + + + +
        +
      • +

        getMiddleMan

        +
        public java.lang.String getMiddleMan(int type)
        +
        Get Middleman
        +
        +
        Parameters:
        +
        type - 0 = finger, 1 = nick
        +
        Returns:
        +
        fingerprint as string
        +
        +
      • +
      + + + +
        +
      • +

        getExit

        +
        public java.lang.String getExit(int type)
        +
        Get Exitnode
        +
        +
        Parameters:
        +
        type - 0 = finger, 1 = nick
        +
        Returns:
        +
        fingerprint as string
        +
        +
      • +
      + + + +
        +
      • +

        getFromNodeHop

        +
        public static java.lang.String getFromNodeHop(java.lang.String nodeinfo,
        +                                              int type)
        +
        Get fingerprint of given node Nodeinfo is in the format of + fingerprint~name or fingerprint=name
        +
        +
        Parameters:
        +
        nodeinfo -
        +
        type - 0 = finger, 1 = nickname
        +
        Returns:
        +
        fingerprint as string
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/TorController.html b/javadoc/client/TorController.html new file mode 100644 index 0000000..fbb99fb --- /dev/null +++ b/javadoc/client/TorController.html @@ -0,0 +1,1547 @@ + + + + + + +TorController (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class TorController

+
+
+ +
+
    +
  • +
    +
    +
    public class TorController
    +extends TorProcess
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TorController

        +
        public TorController(java.lang.String clientpath,
        +                     java.lang.String configfolder)
        +
        Constructor
        +
        +
        Parameters:
        +
        clientpath - Path to Tor client
        +
        configfolder - Location of configuration file torrc
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        torProcessEventFired

        +
        public final void torProcessEventFired(int event,
        +                                       java.lang.String data)
        +
        Tor process event
        +
        +
        Overrides:
        +
        torProcessEventFired in class TorProcess
        +
        Parameters:
        +
        event -
        +
        data -
        +
        +
      • +
      + + + +
        +
      • +

        getEventMessage

        +
        public java.lang.String getEventMessage(int event)
        +
        Description copied from class: TorProcess
        +
        Get textual representation on an event
        +
        +
        Overrides:
        +
        getEventMessage in class TorProcess
        +
        Returns:
        +
        Event as text
        +
        +
      • +
      + + + +
        +
      • +

        controllerEventFired

        +
        public void controllerEventFired(int event,
        +                                 java.lang.Object data)
        +
        Handle for controllerEventFired should be overridden by parent class
        +
        +
        Parameters:
        +
        event -
        +
        data -
        +
        +
      • +
      + + + +
        +
      • +

        setStatus

        +
        public void setStatus(int status)
        +
        Set status flag
        +
        +
        Parameters:
        +
        status -
        +
        +
      • +
      + + + +
        +
      • +

        getStatus

        +
        public int getStatus()
        +
        Get current status
        +
        +
        Returns:
        +
        status integer constant, see defined status constants
        +
        +
      • +
      + + + +
        +
      • +

        isIdle

        +
        public boolean isIdle()
        +
        Convenience test for idle status
        +
        +
        Returns:
        +
        true if idle
        +
        +
      • +
      + + + +
        +
      • +

        stop

        +
        public final void stop()
        +
        Stop the tor controller process completely
        +
      • +
      + + + +
        +
      • +

        start

        +
        public final void start()
        +
        Start tor controller process and issue the TOR_BOOTED event
        +
      • +
      + + + +
        +
      • +

        start

        +
        public final void start(int bootevent)
        +
        Start tor controller process and issue the given event
        +
        +
        Parameters:
        +
        bootevent -
        +
        +
      • +
      + + + +
        +
      • +

        abortActions

        +
        public final void abortActions()
        +
        Abort all current actions
        +
      • +
      + + + +
        +
      • +

        abortLatencyCheck

        +
        public final void abortLatencyCheck()
        +
        Abort latency checking
        +
      • +
      + + + +
        +
      • +

        saveConf

        +
        public void saveConf()
        +
        Save configuration file
        +
      • +
      + + + +
        +
      • +

        loadConf

        +
        public void loadConf()
        +
        Load configuration file
        +
      • +
      + + + +
        +
      • +

        getCountryFromIP

        +
        public java.lang.String getCountryFromIP(java.lang.String ip)
        +
        Attempts to return the Country associated with an ip address
        +
        +
        Parameters:
        +
        ip -
        +
        Returns:
        +
        Country or null if not found
        +
        +
      • +
      + + + +
        +
      • +

        setTestingURL

        +
        public void setTestingURL(java.lang.String url)
        +
        Set the url used for latency checking
        +
        +
        Parameters:
        +
        url -
        +
        +
      • +
      + + + +
        +
      • +

        enablePredictiveCircuits

        +
        public void enablePredictiveCircuits(boolean enabled)
        +
        Enable/Disable predictive circuit building
        +
        +
        Parameters:
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        getInfo

        +
        public final java.util.ArrayList<java.lang.String> getInfo(java.lang.String property)
        +
        Get tor status information for a given property. See TOR control-spec + documentation for valid properties
        +
        +
        Parameters:
        +
        property -
        +
        Returns:
        +
        Arraylist containg the result of the command
        +
        +
      • +
      + + + +
        +
      • +

        closeCircuit

        +
        public final void closeCircuit(java.lang.String id)
        +
        Close a circuit with ID
        +
        +
        Parameters:
        +
        id -
        +
        +
      • +
      + + + +
        +
      • +

        setConf

        +
        public final java.util.ArrayList<java.lang.String> setConf(java.lang.String property)
        +
        Set a tor configuration property
        +
        +
        Parameters:
        +
        property -
        +
        Returns:
        +
        Arraylist containg the result of the command
        +
        +
      • +
      + + + +
        +
      • +

        resetConf

        +
        public final java.util.ArrayList<java.lang.String> resetConf(java.lang.String property)
        +
        reset a tor configuration property
        +
        +
        Parameters:
        +
        property -
        +
        Returns:
        +
        Arraylist containing the result of the command
        +
        +
      • +
      + + + +
        +
      • +

        signal

        +
        public final java.util.ArrayList<java.lang.String> signal(java.lang.String cmd)
        +
        Send signal to tor
        +
        +
        Parameters:
        +
        cmd -
        +
        Returns:
        +
        Arraylist containing the result of the command
        +
        +
      • +
      + + + +
        +
      • +

        getEntryGuardsAsCSV

        +
        public java.lang.String getEntryGuardsAsCSV()
        +
        Get entry guards chosen by tor client
        +
        +
        Returns:
        +
        entry guards as comma separated fingerprints
        +
        +
      • +
      + + + +
        +
      • +

        doLatencyCheck

        +
        public final void doLatencyCheck(int timeout)
        +
        Triggers a socks latency check, EVENT_LATENCY_CHECK is fired on + completion
        +
        +
        Parameters:
        +
        timeout -
        +
        +
      • +
      + + + +
        +
      • +

        getLatency

        +
        public final long getLatency()
        +
        Get current latency
        +
        +
        Returns:
        +
        latency in ms as long
        +
        +
      • +
      + + + +
        +
      • +

        getTorLatency

        +
        public long getTorLatency(int timeout)
        +
        Returns measured latency for the active circuit without creating a + stream, this blocks so be careful
        +
        +
        Parameters:
        +
        timeout -
        +
        Returns:
        +
        latency
        +
        +
      • +
      + + + +
        +
      • +

        closeCircuitsExcept

        +
        public void closeCircuitsExcept(java.lang.String id,
        +                                boolean filtered)
        +
        Close open circuits except circuit specified by id
        +
        +
        Parameters:
        +
        id -
        +
        filtered -
        +
        +
      • +
      + + + +
        +
      • +

        getActiveStreams

        +
        public final java.util.ArrayList<java.lang.String> getActiveStreams()
        +
        Get list of active streams
        +
        +
        Returns:
        +
        active streams as a list
        +
        +
      • +
      + + + +
        +
      • +

        activateNodes

        +
        public final void activateNodes(java.lang.String fingers,
        +                                int nocircs)
        +
        Set the csv list of exit node fingers to be used by tor, a single exit + node may also be specified, this does not block
        +
        +
        Parameters:
        +
        fingers -
        +
        nocircs -
        +
        +
      • +
      + + + +
        +
      • +

        activateCircuit

        +
        public final void activateCircuit(java.lang.String hops)
        +
        Activate given circuit, does not block
        +
        +
        Parameters:
        +
        hops -
        +
        +
      • +
      + + + +
        +
      • +

        setEntryNodes

        +
        public void setEntryNodes(java.lang.String fingers)
        +
        Set entry nodes
        +
        +
        Parameters:
        +
        fingers -
        +
        +
      • +
      + + + +
        +
      • +

        getEntryNodes

        +
        public java.lang.String getEntryNodes()
        +
        Get configured entry nodes
        +
        +
        Returns:
        +
        entry nodes in CSV format
        +
        +
      • +
      + + + +
        +
      • +

        activateNodesBlocking

        +
        public void activateNodesBlocking(java.lang.String fingers,
        +                                  int nocircs)
        +
        Set the csv list of exit node fingers to be used by tor, a single exit + node may also be specified, this blocks
        +
        +
        Parameters:
        +
        fingers -
        +
        nocircs -
        +
        +
      • +
      + + + +
        +
      • +

        haveValidEntryNode

        +
        public boolean haveValidEntryNode()
        +
      • +
      + + + +
        +
      • +

        testNode

        +
        public void testNode(java.lang.String finger)
        +
        Test specified node, non blocking
        +
        +
        Parameters:
        +
        finger -
        +
        +
      • +
      + + + +
        +
      • +

        getBestLatency

        +
        public final long getBestLatency()
        +
        Get best latency
        +
        +
        Returns:
        +
        best latency value in ms as long
        +
        +
      • +
      + + + +
        +
      • +

        getBestHops

        +
        public final java.lang.String getBestHops()
        +
        Get best hops
        +
        +
        Returns:
        +
        hops info as string
        +
        +
      • +
      + + + +
        +
      • +

        getBuiltCircuits

        +
        public final java.util.HashMap<java.lang.String,TorCircuit> getBuiltCircuits(boolean filtered)
        +
        Get built circuits
        +
        +
        Parameters:
        +
        filtered - Filter out unwanted circuits
        +
        Returns:
        +
        HashMap of built circuits keyed to their circuit id
        +
        +
      • +
      + + + +
        +
      • +

        verifyControlComms

        +
        public final boolean verifyControlComms()
        +
        Verify we have comms on the control socket
        +
        +
        Returns:
        +
        true if its good
        +
        +
      • +
      + + + +
        +
      • +

        getLatestCircuit

        +
        public final TorCircuit getLatestCircuit()
        +
        Get the latest circuit
        +
        +
        Returns:
        +
        circuit
        +
        +
      • +
      + + + +
        +
      • +

        sendCommand

        +
        public final java.util.ArrayList<java.lang.String> sendCommand(java.lang.String command)
        +
        Send a command to tor client
        +
        +
        Parameters:
        +
        command -
        +
        Returns:
        +
        Arraylist containing the result of the command
        +
        +
      • +
      + + + +
        +
      • +

        createTorSocketToURL

        +
        public java.net.Socket createTorSocketToURL(java.lang.String url,
        +                                            boolean nowww)
        +
        Create a socks4a socket to this URL on this tor connection, if nowww is + true then remove www. from domain
        +
        +
        Parameters:
        +
        url -
        +
        nowww -
        +
        Returns:
        +
        socket
        +
        +
      • +
      + + + +
        +
      • +

        createSocks4aSocket

        +
        public java.net.Socket createSocks4aSocket(java.lang.String socksaddr,
        +                                           int socksport,
        +                                           java.lang.String remotehost,
        +                                           int remoteport)
        +
        Create a Socks4a socket Taken from Wikipedia SOCKS4a is a simple + extension to SOCKS4 protocol that allows a client that cannot resolve the + destination host's domain name to specify it. + + The client should set the first three bytes of DSTIP to NULL and the last + byte to a non-zero value. (This corresponds to IP address 0.0.0.x, with x + nonzero, an inadmissible destination address and thus should never occur + if the client can resolve the domain name.) Following the NULL byte + terminating USERID, the client must send the destination domain name and + terminate it with another NULL byte. This is used for both "connect" and + "bind" requests. + + Client to SOCKS server: field 1: SOCKS version number, 1 byte, must be + 0x04 for this version field 2: command code, 1 byte: 0x01 = establish a + TCP/IP stream connection 0x02 = establish a TCP/IP port binding field 3: + network byte order port number, 2 bytes field 4: deliberate invalid IP + address, 4 bytes, first three must be 0x00 and the last one must not be + 0x00 field 5: the user ID string, variable length, terminated with a null + (0x00) field 6: the domain name of the host we want to contact, variable + length, terminated with a null (0x00) + + + Server to SOCKS client: field 1: null byte field 2: status, 1 byte: 0x5a + = request granted 0x5b = request rejected or failed 0x5c = request failed + because client is not running identd (or not reachable from the server) + 0x5d = request failed because client's identd could not confirm the user + ID string in the request field 3: network byte order port number, 2 bytes + field 4: network byte order IP address, 4 bytes + + A server using protocol SOCKS4A must check the DSTIP in the request + packet. If it represents address 0.0.0.x with nonzero x, the server must + read in the domain name that the client sends in the packet. The server + should resolve the domain name and make connection to the destination + host if it can.
        +
        +
        Parameters:
        +
        socksaddr - Socks ip address
        +
        socksport - Socks port
        +
        remotehost - Remote host
        +
        remoteport - Remote port
        +
        Returns:
        +
        Socket
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/TorMonFrame.html b/javadoc/client/TorMonFrame.html new file mode 100644 index 0000000..fdc9acb --- /dev/null +++ b/javadoc/client/TorMonFrame.html @@ -0,0 +1,458 @@ + + + + + + +TorMonFrame (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class TorMonFrame

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • java.awt.Window
        • +
        • +
            +
          • java.awt.Frame
          • +
          • +
              +
            • javax.swing.JFrame
            • +
            • +
                +
              • client.TorMonFrame
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    +
    +
    +
    +
    public class TorMonFrame
    +extends javax.swing.JFrame
    +
    +
    Author:
    +
    Alistair Neil
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JFrame

        +javax.swing.JFrame.AccessibleJFrame
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Frame

        +java.awt.Frame.AccessibleAWTFrame
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Window

        +java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javax.swing.JFrame

        +accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Frame

        +CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface javax.swing.WindowConstants

        +DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TorMonFrame() +
      Creates new form TorMonFrame
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      javax.swing.JTextAreagetStdoutTextArea() 
      voidsetLaunchString(java.lang.String command) +
      Set launch command text
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JFrame

        +addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Frame

        +addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Window

        +addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
        +
      • + + +

        Methods inherited from interface java.awt.MenuContainer

        +getFont, postEvent
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TorMonFrame

        +
        public TorMonFrame()
        +
        Creates new form TorMonFrame
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setLaunchString

        +
        public void setLaunchString(java.lang.String command)
        +
        Set launch command text
        +
        +
        Parameters:
        +
        command -
        +
        +
      • +
      + + + +
        +
      • +

        getStdoutTextArea

        +
        public javax.swing.JTextArea getStdoutTextArea()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/TorProcess.html b/javadoc/client/TorProcess.html new file mode 100644 index 0000000..995466a --- /dev/null +++ b/javadoc/client/TorProcess.html @@ -0,0 +1,1551 @@ + + + + + + +TorProcess (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
client
+

Class TorProcess

+
+
+ +
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    TorController
    +
    +
    +
    +
    public class TorProcess
    +extends ClientProcess
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TorProcess(java.lang.String clientpath, + java.lang.String configfolder) +
      Constructor
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidclearCLIOption(java.lang.String option) +
      Remove previously add tor option
      +
      voidclearStdout() +
      Clear the Stdout text area
      +
      voidclearTorrcOption(java.lang.String option) +
      Remove previously add torrc option
      +
      voidclientProcessEventFired(java.lang.String data) +
      Client event handler, can be overriden by parent class
      +
      voidcreateDataFolder() +
      Creates a data folder for the Tor client to put its cache data
      +
      voidcreateDefaultConfig() +
      Creates the default Tor config file
      +
      voiddeleteCacheData() +
      Delete Tor cache data
      +
      voiddeleteConfigFile() +
      Delete the configuration file
      +
      java.lang.StringgetBridges() +
      Get bridges
      +
      floatgetCacheAge() +
      Get the age of the file cache in minutes
      +
      java.lang.StringgetCachedDataFolder() +
      Get the currently set cached data folder
      +
      java.lang.StringgetClientLocation() +
      Get Tor client location as a filepath
      +
      booleangetCLIOptionBool(java.lang.String option) +
      Get a previously added tor option boolean value
      +
      java.lang.StringgetCLIOptions(java.lang.String option) +
      Get a previously added tor option string
      +
      java.lang.StringgetCLIOptionsAsString() +
      Gets all the currently set tor options as single String for use as + arguments passed to tor client
      +
      java.lang.StringgetConfigFilePath() +
      Get the path to the configuration file
      +
      intgetControlPort() +
      Get the control port
      +
      java.lang.StringgetDataFolder() +
      Get the datafolder being used by tor client
      +
      java.lang.StringgetEventMessage(int event) +
      Get textual representation on an event
      +
      intgetListenPort() +
      Get the listening port
      +
      java.lang.StringgetOwnershipID() +
      Return the currently set process ownership ID
      +
      java.lang.StringgetSecret() +
      Get the currently set authentification secret
      +
      java.lang.StringgetTorrcOption(java.lang.String option) +
      Get a previously added tor option string
      +
      java.lang.StringgetTorrcOptionsAsString() +
      Gets all the currently set torrc options as single String
      +
      floatgetVersion() +
      Get Tor version as float
      +
      voidsetBoolTorOption(java.lang.String option, + boolean value) +
      Add a tor option boolean value
      +
      voidsetBridges(java.lang.String bridges) +
      Set Tor bridges, supports multiple addresses
      +
      voidsetCachedDataFolder(int port) +
      This populates the the current folder whose name is derived from the + listening port with data from the given source folder derived by the + given port number.
      +
      voidsetCLIOption(java.lang.String option, + java.lang.String value) +
      Add a tor option string which is passed to the tor client on startup.
      +
      voidsetControlPassword(java.lang.String secret, + java.lang.String hashpass) 
      voidsetExternalArgs(java.lang.String torargs) +
      Set external user provided startup arguments
      +
      voidsetGeoIP4(java.lang.String filepath) +
      Set the path to the geoip file
      +
      voidsetGeoIP6(java.lang.String filepath) +
      Set the path to the geoip file
      +
      voidsetInitialBootEvent(int event) +
      Set the event that is issued on process boot completion
      +
      voidsetListenPort(int port) +
      Set the listening port
      +
      voidsetLogLevel(int lev) +
      Set the Tor stdout log level
      +
      voidsetMaxHistory(int lines) +
      Set the maximum no of lines to display in the Stdout output
      +
      voidsetOwnershipID(java.lang.String processid) +
      Set Ownership process id, useful for proper process termination in event + of a crash
      +
      voidsetSilentBootEnabled(boolean enabled) +
      Enable/Disable bootstrap message events on startup
      +
      voidsetStdoutTextArea(javax.swing.JTextArea jta) +
      Set the text area that will receive Stdout output
      +
      voidsetTorrcOption(java.lang.String option, + java.lang.String value) +
      Add a torrc option string See Tor documentation for valid options.
      +
      voidstartProcess() +
      Starts Tor process, and issues booted event on completion
      +
      voidtorProcessEventFired(int event, + java.lang.String data) +
      Called if an event was fired, will be overidden by sub class
      +
      booleanvalidateBridges(java.lang.String bridges) +
      Validate bridge addresses
      +
      booleanvalidateHostPort(java.lang.String hostport) +
      Validate a host:port ipv4 address
      +
      + +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TorProcess

        +
        public TorProcess(java.lang.String clientpath,
        +                  java.lang.String configfolder)
        +
        Constructor
        +
        +
        Parameters:
        +
        clientpath - Path to Tor client
        +
        configfolder - Filepath to torrc
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        startProcess

        +
        public final void startProcess()
        +
        Starts Tor process, and issues booted event on completion
        +
      • +
      + + + +
        +
      • +

        setLogLevel

        +
        public final void setLogLevel(int lev)
        +
        Set the Tor stdout log level
        +
        +
        Parameters:
        +
        lev -
        +
        +
      • +
      + + + +
        +
      • +

        setExternalArgs

        +
        public final void setExternalArgs(java.lang.String torargs)
        +
        Set external user provided startup arguments
        +
        +
        Parameters:
        +
        torargs -
        +
        +
      • +
      + + + +
        +
      • +

        setListenPort

        +
        public final void setListenPort(int port)
        +
        Set the listening port
        +
        +
        Parameters:
        +
        port -
        +
        +
      • +
      + + + +
        +
      • +

        setInitialBootEvent

        +
        public final void setInitialBootEvent(int event)
        +
        Set the event that is issued on process boot completion
        +
        +
        Parameters:
        +
        event -
        +
        +
      • +
      + + + +
        +
      • +

        clientProcessEventFired

        +
        public final void clientProcessEventFired(java.lang.String data)
        +
        Client event handler, can be overriden by parent class
        +
        +
        Overrides:
        +
        clientProcessEventFired in class ClientProcess
        +
        Parameters:
        +
        data - line data from standard output of Tor client
        +
        +
      • +
      + + + +
        +
      • +

        setSilentBootEnabled

        +
        public final void setSilentBootEnabled(boolean enabled)
        +
        Enable/Disable bootstrap message events on startup
        +
        +
        Parameters:
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        getEventMessage

        +
        public java.lang.String getEventMessage(int event)
        +
        Get textual representation on an event
        +
        +
        Parameters:
        +
        event -
        +
        Returns:
        +
        Event as text
        +
        +
      • +
      + + + +
        +
      • +

        torProcessEventFired

        +
        public void torProcessEventFired(int event,
        +                                 java.lang.String data)
        +
        Called if an event was fired, will be overidden by sub class
        +
        +
        Parameters:
        +
        event -
        +
        data -
        +
        +
      • +
      + + + +
        +
      • +

        setControlPassword

        +
        public final void setControlPassword(java.lang.String secret,
        +                                     java.lang.String hashpass)
        +
      • +
      + + + +
        +
      • +

        getSecret

        +
        public final java.lang.String getSecret()
        +
        Get the currently set authentification secret
        +
        +
        Returns:
        +
        String
        +
        +
      • +
      + + + +
        +
      • +

        setBridges

        +
        public final void setBridges(java.lang.String bridges)
        +
        Set Tor bridges, supports multiple addresses
        +
        +
        Parameters:
        +
        bridges -
        +
        +
      • +
      + + + +
        +
      • +

        validateBridges

        +
        public boolean validateBridges(java.lang.String bridges)
        +
        Validate bridge addresses
        +
        +
        Parameters:
        +
        bridges -
        +
        Returns:
        +
        true if valid
        +
        +
      • +
      + + + +
        +
      • +

        validateHostPort

        +
        public final boolean validateHostPort(java.lang.String hostport)
        +
        Validate a host:port ipv4 address
        +
        +
        Parameters:
        +
        hostport -
        +
        Returns:
        +
        true if valid
        +
        +
      • +
      + + + +
        +
      • +

        getBridges

        +
        public final java.lang.String getBridges()
        +
        Get bridges
        +
        +
        Returns:
        +
        bridges as csv string
        +
        +
      • +
      + + + +
        +
      • +

        setOwnershipID

        +
        public void setOwnershipID(java.lang.String processid)
        +
        Set Ownership process id, useful for proper process termination in event + of a crash
        +
        +
        Parameters:
        +
        processid -
        +
        +
      • +
      + + + +
        +
      • +

        getOwnershipID

        +
        public java.lang.String getOwnershipID()
        +
        Return the currently set process ownership ID
        +
        +
        Returns:
        +
        String process id
        +
        +
      • +
      + + + +
        +
      • +

        setGeoIP4

        +
        public final void setGeoIP4(java.lang.String filepath)
        +
        Set the path to the geoip file
        +
        +
        Parameters:
        +
        filepath - File location
        +
        +
      • +
      + + + +
        +
      • +

        setGeoIP6

        +
        public final void setGeoIP6(java.lang.String filepath)
        +
        Set the path to the geoip file
        +
        +
        Parameters:
        +
        filepath - File location
        +
        +
      • +
      + + + +
        +
      • +

        getClientLocation

        +
        public final java.lang.String getClientLocation()
        +
        Get Tor client location as a filepath
        +
        +
        Returns:
        +
        filepath as string
        +
        +
      • +
      + + + +
        +
      • +

        getConfigFilePath

        +
        public final java.lang.String getConfigFilePath()
        +
        Get the path to the configuration file
        +
        +
        Returns:
        +
        String Path to configuration file
        +
        +
      • +
      + + + +
        +
      • +

        getCLIOptions

        +
        public final java.lang.String getCLIOptions(java.lang.String option)
        +
        Get a previously added tor option string
        +
        +
        Parameters:
        +
        option - Tor option key
        +
        Returns:
        +
        String Tor option value
        +
        +
      • +
      + + + +
        +
      • +

        setCLIOption

        +
        public final void setCLIOption(java.lang.String option,
        +                               java.lang.String value)
        +
        Add a tor option string which is passed to the tor client on startup. See + Tor documentation for valid options.
        +
        +
        Parameters:
        +
        option -
        +
        value -
        +
        +
      • +
      + + + +
        +
      • +

        setBoolTorOption

        +
        public final void setBoolTorOption(java.lang.String option,
        +                                   boolean value)
        +
        Add a tor option boolean value
        +
        +
        Parameters:
        +
        option -
        +
        value -
        +
        +
      • +
      + + + +
        +
      • +

        getTorrcOption

        +
        public final java.lang.String getTorrcOption(java.lang.String option)
        +
        Get a previously added tor option string
        +
        +
        Parameters:
        +
        option - Tor option key
        +
        Returns:
        +
        String Tor option value
        +
        +
      • +
      + + + +
        +
      • +

        setTorrcOption

        +
        public final void setTorrcOption(java.lang.String option,
        +                                 java.lang.String value)
        +
        Add a torrc option string See Tor documentation for valid options.
        +
        +
        Parameters:
        +
        option -
        +
        value -
        +
        +
      • +
      + + + +
        +
      • +

        getTorrcOptionsAsString

        +
        public final java.lang.String getTorrcOptionsAsString()
        +
        Gets all the currently set torrc options as single String
        +
        +
        Returns:
        +
        String Tor client formatted cli arguments
        +
        +
      • +
      + + + +
        +
      • +

        clearTorrcOption

        +
        public final void clearTorrcOption(java.lang.String option)
        +
        Remove previously add torrc option
        +
        +
        Parameters:
        +
        option -
        +
        +
      • +
      + + + +
        +
      • +

        getCLIOptionBool

        +
        public final boolean getCLIOptionBool(java.lang.String option)
        +
        Get a previously added tor option boolean value
        +
        +
        Parameters:
        +
        option - Tor option key
        +
        Returns:
        +
        Boolean value
        +
        +
      • +
      + + + +
        +
      • +

        clearCLIOption

        +
        public final void clearCLIOption(java.lang.String option)
        +
        Remove previously add tor option
        +
        +
        Parameters:
        +
        option -
        +
        +
      • +
      + + + +
        +
      • +

        getCLIOptionsAsString

        +
        public final java.lang.String getCLIOptionsAsString()
        +
        Gets all the currently set tor options as single String for use as + arguments passed to tor client
        +
        +
        Returns:
        +
        String Tor cleint formatted cli arguments
        +
        +
      • +
      + + + +
        +
      • +

        getListenPort

        +
        public final int getListenPort()
        +
        Get the listening port
        +
        +
        Returns:
        +
        port
        +
        +
      • +
      + + + +
        +
      • +

        getControlPort

        +
        public final int getControlPort()
        +
        Get the control port
        +
        +
        Returns:
        +
        port
        +
        +
      • +
      + + + +
        +
      • +

        createDefaultConfig

        +
        public final void createDefaultConfig()
        +
        Creates the default Tor config file
        +
      • +
      + + + +
        +
      • +

        deleteConfigFile

        +
        public final void deleteConfigFile()
        +
        Delete the configuration file
        +
      • +
      + + + +
        +
      • +

        createDataFolder

        +
        public final void createDataFolder()
        +
        Creates a data folder for the Tor client to put its cache data
        +
      • +
      + + + +
        +
      • +

        getDataFolder

        +
        public final java.lang.String getDataFolder()
        +
        Get the datafolder being used by tor client
        +
        +
        Returns:
        +
        Path to datafolder
        +
        +
      • +
      + + + +
        +
      • +

        getCacheAge

        +
        public float getCacheAge()
        +
        Get the age of the file cache in minutes
        +
        +
        Returns:
        +
        age of cache in minutes
        +
        +
      • +
      + + + +
        +
      • +

        deleteCacheData

        +
        public final void deleteCacheData()
        +
        Delete Tor cache data
        +
      • +
      + + + +
        +
      • +

        setCachedDataFolder

        +
        public final void setCachedDataFolder(int port)
        +
        This populates the the current folder whose name is derived from the + listening port with data from the given source folder derived by the + given port number. This effectively allows each Tor client spawned to + have its Tor cache data copied from the first Tor client launched instead + of having to go to the net and fetch it and thus start up is a lot + faster. I was actually mildly suprised that this actually works.
        +
        +
        Parameters:
        +
        port -
        +
        +
      • +
      + + + +
        +
      • +

        getCachedDataFolder

        +
        public final java.lang.String getCachedDataFolder()
        +
        Get the currently set cached data folder
        +
        +
        Returns:
        +
        path to cached data folder as String
        +
        +
      • +
      + + + +
        +
      • +

        setStdoutTextArea

        +
        public void setStdoutTextArea(javax.swing.JTextArea jta)
        +
        Set the text area that will receive Stdout output
        +
        +
        Parameters:
        +
        jta -
        +
        +
      • +
      + + + +
        +
      • +

        setMaxHistory

        +
        public void setMaxHistory(int lines)
        +
        Set the maximum no of lines to display in the Stdout output
        +
        +
        Parameters:
        +
        lines -
        +
        +
      • +
      + + + +
        +
      • +

        clearStdout

        +
        public void clearStdout()
        +
        Clear the Stdout text area
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        public final float getVersion()
        +
        Get Tor version as float
        +
        +
        Returns:
        +
        Tor version as String
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/client/class-use/ExitNodeTableModel.html b/javadoc/client/class-use/ExitNodeTableModel.html new file mode 100644 index 0000000..69557b3 --- /dev/null +++ b/javadoc/client/class-use/ExitNodeTableModel.html @@ -0,0 +1,167 @@ + + + + + + +Uses of Class client.ExitNodeTableModel (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.ExitNodeTableModel

+
+
+ +
+ + + + + + diff --git a/javadoc/client/class-use/GuardNodeDialog.html b/javadoc/client/class-use/GuardNodeDialog.html new file mode 100644 index 0000000..9743364 --- /dev/null +++ b/javadoc/client/class-use/GuardNodeDialog.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class client.GuardNodeDialog (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.GuardNodeDialog

+
+
No usage of client.GuardNodeDialog
+ + + + + + diff --git a/javadoc/client/class-use/GuardNodeTableModel.html b/javadoc/client/class-use/GuardNodeTableModel.html new file mode 100644 index 0000000..6a57395 --- /dev/null +++ b/javadoc/client/class-use/GuardNodeTableModel.html @@ -0,0 +1,167 @@ + + + + + + +Uses of Class client.GuardNodeTableModel (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.GuardNodeTableModel

+
+
+ +
+ + + + + + diff --git a/javadoc/client/class-use/NodeItem.html b/javadoc/client/class-use/NodeItem.html new file mode 100644 index 0000000..7123c09 --- /dev/null +++ b/javadoc/client/class-use/NodeItem.html @@ -0,0 +1,177 @@ + + + + + + +Uses of Class client.NodeItem (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.NodeItem

+
+
+ +
+ + + + + + diff --git a/javadoc/client/class-use/NodeList.html b/javadoc/client/class-use/NodeList.html new file mode 100644 index 0000000..cc4cc6d --- /dev/null +++ b/javadoc/client/class-use/NodeList.html @@ -0,0 +1,167 @@ + + + + + + +Uses of Class client.NodeList (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.NodeList

+
+
+ +
+ + + + + + diff --git a/javadoc/client/class-use/PacFactory.html b/javadoc/client/class-use/PacFactory.html new file mode 100644 index 0000000..1ac03e1 --- /dev/null +++ b/javadoc/client/class-use/PacFactory.html @@ -0,0 +1,167 @@ + + + + + + +Uses of Class client.PacFactory (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.PacFactory

+
+
+ +
+ + + + + + diff --git a/javadoc/client/class-use/PatternsEditor.CustomTableCellRenderer.html b/javadoc/client/class-use/PatternsEditor.CustomTableCellRenderer.html new file mode 100644 index 0000000..b96dfc6 --- /dev/null +++ b/javadoc/client/class-use/PatternsEditor.CustomTableCellRenderer.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class client.PatternsEditor.CustomTableCellRenderer (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.PatternsEditor.CustomTableCellRenderer

+
+
No usage of client.PatternsEditor.CustomTableCellRenderer
+ + + + + + diff --git a/javadoc/client/class-use/PatternsEditor.PACTableModel.html b/javadoc/client/class-use/PatternsEditor.PACTableModel.html new file mode 100644 index 0000000..110c12a --- /dev/null +++ b/javadoc/client/class-use/PatternsEditor.PACTableModel.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class client.PatternsEditor.PACTableModel (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.PatternsEditor.PACTableModel

+
+
No usage of client.PatternsEditor.PACTableModel
+ + + + + + diff --git a/javadoc/client/class-use/PatternsEditor.html b/javadoc/client/class-use/PatternsEditor.html new file mode 100644 index 0000000..c1b64ef --- /dev/null +++ b/javadoc/client/class-use/PatternsEditor.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class client.PatternsEditor (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.PatternsEditor

+
+
No usage of client.PatternsEditor
+ + + + + + diff --git a/javadoc/client/class-use/PrefsDialog.html b/javadoc/client/class-use/PrefsDialog.html new file mode 100644 index 0000000..a3e3b09 --- /dev/null +++ b/javadoc/client/class-use/PrefsDialog.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class client.PrefsDialog (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.PrefsDialog

+
+
No usage of client.PrefsDialog
+ + + + + + diff --git a/javadoc/client/class-use/QuickAddDialog.html b/javadoc/client/class-use/QuickAddDialog.html new file mode 100644 index 0000000..fa4b1d0 --- /dev/null +++ b/javadoc/client/class-use/QuickAddDialog.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class client.QuickAddDialog (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.QuickAddDialog

+
+
No usage of client.QuickAddDialog
+ + + + + + diff --git a/javadoc/client/class-use/SelekTOR.html b/javadoc/client/class-use/SelekTOR.html new file mode 100644 index 0000000..1901f19 --- /dev/null +++ b/javadoc/client/class-use/SelekTOR.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class client.SelekTOR (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.SelekTOR

+
+
No usage of client.SelekTOR
+ + + + + + diff --git a/javadoc/client/class-use/TorCircuit.html b/javadoc/client/class-use/TorCircuit.html new file mode 100644 index 0000000..4395911 --- /dev/null +++ b/javadoc/client/class-use/TorCircuit.html @@ -0,0 +1,182 @@ + + + + + + +Uses of Class client.TorCircuit (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.TorCircuit

+
+
+ +
+ + + + + + diff --git a/javadoc/client/class-use/TorController.html b/javadoc/client/class-use/TorController.html new file mode 100644 index 0000000..269bf18 --- /dev/null +++ b/javadoc/client/class-use/TorController.html @@ -0,0 +1,167 @@ + + + + + + +Uses of Class client.TorController (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.TorController

+
+
+ +
+ + + + + + diff --git a/javadoc/client/class-use/TorMonFrame.html b/javadoc/client/class-use/TorMonFrame.html new file mode 100644 index 0000000..ec98f4d --- /dev/null +++ b/javadoc/client/class-use/TorMonFrame.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class client.TorMonFrame (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.TorMonFrame

+
+
No usage of client.TorMonFrame
+ + + + + + diff --git a/javadoc/client/class-use/TorProcess.html b/javadoc/client/class-use/TorProcess.html new file mode 100644 index 0000000..2fe3f5e --- /dev/null +++ b/javadoc/client/class-use/TorProcess.html @@ -0,0 +1,165 @@ + + + + + + +Uses of Class client.TorProcess (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
client.TorProcess

+
+
+ +
+ + + + + + diff --git a/javadoc/client/package-frame.html b/javadoc/client/package-frame.html new file mode 100644 index 0000000..42987a9 --- /dev/null +++ b/javadoc/client/package-frame.html @@ -0,0 +1,34 @@ + + + + + + +client (SelekTOR Java Documentation) + + + + + +

client

+ + + diff --git a/javadoc/client/package-summary.html b/javadoc/client/package-summary.html new file mode 100644 index 0000000..f65b8c1 --- /dev/null +++ b/javadoc/client/package-summary.html @@ -0,0 +1,195 @@ + + + + + + +client (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Package client

+
+
+ +
+ + + + + + diff --git a/javadoc/client/package-tree.html b/javadoc/client/package-tree.html new file mode 100644 index 0000000..c10e62b --- /dev/null +++ b/javadoc/client/package-tree.html @@ -0,0 +1,208 @@ + + + + + + +client Class Hierarchy (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Hierarchy For Package client

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • javax.swing.table.AbstractTableModel (implements java.io.Serializable, javax.swing.table.TableModel) + +
    • +
    • lib.ClientProcess + +
    • +
    • java.awt.Component (implements java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable) +
        +
      • java.awt.Container +
          +
        • javax.swing.JComponent (implements java.io.Serializable) +
            +
          • javax.swing.JLabel (implements javax.accessibility.Accessible, javax.swing.SwingConstants) + +
          • +
          +
        • +
        • java.awt.Window (implements javax.accessibility.Accessible) +
            +
          • java.awt.Dialog + +
          • +
          • java.awt.Frame (implements java.awt.MenuContainer) +
              +
            • javax.swing.JFrame (implements javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants) + +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • client.NodeItem (implements java.lang.Cloneable)
    • +
    • client.NodeList
    • +
    • client.PacFactory
    • +
    • client.TorCircuit
    • +
    +
  • +
+
+ + + + + + diff --git a/javadoc/client/package-use.html b/javadoc/client/package-use.html new file mode 100644 index 0000000..fc1a8cf --- /dev/null +++ b/javadoc/client/package-use.html @@ -0,0 +1,179 @@ + + + + + + +Uses of Package client (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Package
client

+
+
+ +
+ + + + + + diff --git a/javadoc/constant-values.html b/javadoc/constant-values.html new file mode 100644 index 0000000..027e303 --- /dev/null +++ b/javadoc/constant-values.html @@ -0,0 +1,938 @@ + + + + + + +Constant Field Values (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
+

Constant Field Values

+

Contents

+ +
+
+ + +

client.*

+ + + + +

lib.*

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/deprecated-list.html b/javadoc/deprecated-list.html new file mode 100644 index 0000000..9ccaa29 --- /dev/null +++ b/javadoc/deprecated-list.html @@ -0,0 +1,125 @@ + + + + + + +Deprecated List (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
+

Deprecated API

+

Contents

+
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/help-doc.html b/javadoc/help-doc.html new file mode 100644 index 0000000..32e98a8 --- /dev/null +++ b/javadoc/help-doc.html @@ -0,0 +1,230 @@ + + + + + + +API Help (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
  • +
  • +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:

    +
      +
    • Interfaces (italic)
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
  • +
  • +

    Class/Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class inheritance diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class/interface declaration
    • +
    • Class/interface description
    • +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
      +
    • Field Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
  • +
  • +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type declaration
    • +
    • Annotation Type description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
  • +
  • +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum declaration
    • +
    • Enum description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
  • +
  • +

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
  • +
  • +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
    • +
    +
  • +
  • +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
  • +
  • +

    Index

    +

    The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.

    +
  • +
  • +

    Prev/Next

    +

    These links take you to the next or previous class, interface, package, or related page.

    +
  • +
  • +

    Frames/No Frames

    +

    These links show and hide the HTML frames. All pages are available with or without frames.

    +
  • +
  • +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
  • +
  • +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
  • +
  • +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
  • +
+This help file applies to API documentation generated using the standard doclet.
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-1.html b/javadoc/index-files/index-1.html new file mode 100644 index 0000000..1d2443f --- /dev/null +++ b/javadoc/index-files/index-1.html @@ -0,0 +1,214 @@ + + + + + + +A-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

A

+
+
abortActions() - Method in class client.TorController
+
+
Abort all current actions
+
+
abortLatencyCheck() - Method in class client.TorController
+
+
Abort latency checking
+
+
AboutDialog - Class in lib
+
 
+
AboutDialog(Frame, boolean) - Constructor for class lib.AboutDialog
+
+
Creates new About Dialog
+
+
accept(File) - Method in class lib.ExtensionFileFilter
+
 
+
activateCircuit(String) - Method in class client.TorController
+
+
Activate given circuit, does not block
+
+
activateNodes(String, int) - Method in class client.TorController
+
+
Set the csv list of exit node fingers to be used by tor, a single exit + node may also be specified, this does not block
+
+
activateNodesBlocking(String, int) - Method in class client.TorController
+
+
Set the csv list of exit node fingers to be used by tor, a single exit + node may also be specified, this blocks
+
+
add(JMenuItem) - Method in class lib.TrayPopupMenu
+
 
+
addBridge(String) - Method in class client.NodeList
+
+
Add newly learned bridge to nodelist
+
+
addDirectMatchingRule(ArrayList<String>, String) - Method in class client.PacFactory
+
 
+
addFilesToZip(File...) - Method in class lib.SimpleFile
+
+
Add files to a zip file
+
+
addMouseListener(MouseListener) - Method in class lib.SwingTrayIcon
+
+
Add a mouse listener
+
+
addProxyRule(ArrayList<String>, String) - Method in class client.PacFactory
+
 
+
addRow(Object[]) - Method in class client.ExitNodeTableModel
+
+
Add rowdata with given data object array
+
+
addRow(Object[]) - Method in class client.GuardNodeTableModel
+
+
Add rowdata with given data object array
+
+
addRow(Object[], boolean) - Method in class client.PatternsEditor.PACTableModel
+
 
+
addSocksMatchingRule(ArrayList<String>, String, String, String) - Method in class client.PacFactory
+
+
Add socks pattern mayching rule to a supllied list
+
+
addSocksRule(ArrayList<String>, String, String) - Method in class client.PacFactory
+
+
Add a socks rule to a supplied list
+
+
addToPatternFile(String, String, String) - Method in class client.PacFactory
+
+
Adds pattern to an existing pattern file
+
+
adjustTableColumnWidth(JTable, String...) - Static method in class lib.Utilities
+
+
Adjust specified column width based on the width of a test string
+
+
appendInfoText(String) - Method in class lib.InfoDialog
+
+
Append text to the information area, Scrolling should be enabled
+
+
APPLY - Static variable in class client.GuardNodeDialog
+
 
+
APPLY - Static variable in class client.PatternsEditor
+
 
+
APPLY - Static variable in class client.PrefsDialog
+
 
+
APPLY - Static variable in class client.QuickAddDialog
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-10.html b/javadoc/index-files/index-10.html new file mode 100644 index 0000000..f5a3cba --- /dev/null +++ b/javadoc/index-files/index-10.html @@ -0,0 +1,132 @@ + + + + + + +K-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

K

+
+
killProcess(String) - Static method in class lib.OSFunction
+
+
Generic kill process with matching pid
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-11.html b/javadoc/index-files/index-11.html new file mode 100644 index 0000000..13d43aa --- /dev/null +++ b/javadoc/index-files/index-11.html @@ -0,0 +1,176 @@ + + + + + + +L-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

L

+
+
LATENCY_FAIL - Static variable in class client.TorController
+
 
+
LATENCY_FAIL - Static variable in class lib.NetFunctions
+
 
+
LATENCY_UNKNOWN - Static variable in class lib.NetFunctions
+
 
+
launchProcess(String...) - Static method in class lib.OSFunction
+
+
Launch an external process with arguments
+
+
lib - package lib
+
 
+
load() - Method in class lib.SimpleProps
+
+
Load from xml file
+
+
load() - Method in class lib.SwingTrayIcon
+
+
Load tray icon
+
+
loadAdvancedPrefs(boolean) - Method in class client.PrefsDialog
+
+
Load the preferences
+
+
loadBasicPrefs(boolean) - Method in class client.PrefsDialog
+
 
+
loadConf() - Method in class client.TorController
+
+
Load configuration file
+
+
loadPatternsList(String, ArrayList<String>) - Method in class client.PacFactory
+
+
Load a patterns list from a file
+
+
loadUIStyle(String) - Static method in class lib.Utilities
+
+
Initialises the UI Look and Feel
+
+
Localisation - Class in lib
+
 
+
Localisation(String) - Constructor for class lib.Localisation
+
 
+
LOG_DEBUG - Static variable in class client.TorProcess
+
 
+
LOG_INFO - Static variable in class client.TorProcess
+
 
+
LOG_NOTICE - Static variable in class client.TorProcess
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-12.html b/javadoc/index-files/index-12.html new file mode 100644 index 0000000..5d20aa5 --- /dev/null +++ b/javadoc/index-files/index-12.html @@ -0,0 +1,132 @@ + + + + + + +M-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

M

+
+
main(String[]) - Static method in class SelekTOR
+
 
+
mergeFiles(String, String, String) - Static method in class lib.SimpleFile
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-13.html b/javadoc/index-files/index-13.html new file mode 100644 index 0000000..3ee531a --- /dev/null +++ b/javadoc/index-files/index-13.html @@ -0,0 +1,164 @@ + + + + + + +N-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

N

+
+
NetFunctions - Class in lib
+
 
+
NetFunctions() - Constructor for class lib.NetFunctions
+
 
+
NetFunctions.HttpPage - Class in lib
+
+
Store an http formatted web page
+
+
NICKNAME - Static variable in class client.TorCircuit
+
 
+
NODE_EXIT - Static variable in class client.TorController
+
 
+
NODE_GUARD - Static variable in class client.TorController
+
 
+
NODE_MIDDLE - Static variable in class client.TorController
+
 
+
NodeItem - Class in client
+
 
+
NodeItem() - Constructor for class client.NodeItem
+
 
+
NodeList - Class in client
+
 
+
NodeList(String, String, String) - Constructor for class client.NodeList
+
 
+
NODELIST_BUILDING - Static variable in class client.NodeList
+
 
+
NODELIST_BUILT - Static variable in class client.NodeList
+
 
+
NODELIST_FAILED - Static variable in class client.NodeList
+
 
+
NODELIST_IDLE - Static variable in class client.NodeList
+
 
+
NODELIST_TERMINATED - Static variable in class client.NodeList
+
 
+
NOTFOUND - Static variable in class lib.SimpleFile
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-14.html b/javadoc/index-files/index-14.html new file mode 100644 index 0000000..46f3dd1 --- /dev/null +++ b/javadoc/index-files/index-14.html @@ -0,0 +1,176 @@ + + + + + + +O-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

O

+
+
objectRead(String, Object) - Static method in class lib.SimpleFile
+
 
+
objectWrite(String, Object) - Static method in class lib.SimpleFile
+
 
+
OK - Static variable in class lib.InfoDialog
+
 
+
openBufferedAppend() - Method in class lib.SimpleFile
+
+
Opens a buffered file for append
+
+
openBufferedRead() - Method in class lib.SimpleFile
+
+
Opens a buffered file for read
+
+
openBufferedResource() - Method in class lib.SimpleFile
+
+
Use this if you need access to a file within a jar
+
+
openBufferedWrite() - Method in class lib.SimpleFile
+
+
Opens a buffered file for write
+
+
openFileChooser(Frame, String, FileFilter, int) - Static method in class lib.Utilities
+
+
Opens java file chooser dialog, convenience method.
+
+
openFileExternally(String) - Static method in class lib.Utilities
+
+
Launch the desktops default file handling program
+
+
openFileInputStream(String) - Method in class lib.SimpleFile
+
 
+
openFileOutputStream() - Method in class lib.SimpleFile
+
+
Opens a file output stream
+
+
openStreamToURL(String, Socket) - Method in class lib.NetFunctions
+
+
Open an inputstream to the given url on the given socket
+
+
openZipStream(int) - Method in class lib.SimpleFile
+
+
Opens a zipstream.
+
+
OSFunction - Class in lib
+
 
+
OSFunction() - Constructor for class lib.OSFunction
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-15.html b/javadoc/index-files/index-15.html new file mode 100644 index 0000000..1404522 --- /dev/null +++ b/javadoc/index-files/index-15.html @@ -0,0 +1,189 @@ + + + + + + +P-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

P

+
+
PacFactory - Class in client
+
 
+
PacFactory() - Constructor for class client.PacFactory
+
 
+
PACTableModel() - Constructor for class client.PatternsEditor.PACTableModel
+
+
Constructor
+
+
paintComponent(Graphics) - Method in class lib.TrayPopupMenu
+
 
+
PATTERN_ASCTIME - Static variable in class lib.NetFunctions.HttpPage
+
 
+
PATTERN_RFC1036 - Static variable in class lib.NetFunctions.HttpPage
+
 
+
PATTERN_RFC1123 - Static variable in class lib.NetFunctions.HttpPage
+
 
+
PatternsEditor - Class in client
+
 
+
PatternsEditor(Frame, boolean, PacFactory) - Constructor for class client.PatternsEditor
+
+
Creates a PatternsEditor dialog
+
+
PatternsEditor.CustomTableCellRenderer - Class in client
+
+
CustomTableCellRenderer
+
+
PatternsEditor.PACTableModel - Class in client
+
+
PACTableModel class
+
+
PERIOD_DAYS - Static variable in class lib.SimpleFile
+
 
+
PERIOD_HOURS - Static variable in class lib.SimpleFile
+
 
+
PERIOD_MINUTES - Static variable in class lib.SimpleFile
+
 
+
populateCountryComboBox(String[]) - Method in class client.PatternsEditor
+
+
Populate the country combobox with a list of countries
+
+
PrefsDialog - Class in client
+
 
+
PrefsDialog(Frame, SimpleProps, String) - Constructor for class client.PrefsDialog
+
+
Creates a preferences editor dialog
+
+
preloadFileChooser() - Static method in class lib.Utilities
+
+
Preloads filechooser in background so it will open instantly when + requested
+
+
progressTask(int, JProgressBar) - Method in class lib.InfoDialog
+
+
Overridable handle for a progress based task
+
+
PROXY_ALL - Static variable in class client.PacFactory
+
 
+
PROXY_DISABLED - Static variable in class client.PacFactory
+
 
+
PROXY_PATTERN - Static variable in class client.PacFactory
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-16.html b/javadoc/index-files/index-16.html new file mode 100644 index 0000000..a718ddf --- /dev/null +++ b/javadoc/index-files/index-16.html @@ -0,0 +1,134 @@ + + + + + + +Q-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

Q

+
+
QuickAddDialog - Class in client
+
 
+
QuickAddDialog(Frame, boolean) - Constructor for class client.QuickAddDialog
+
+
Creates a quick add patterns dialog
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-17.html b/javadoc/index-files/index-17.html new file mode 100644 index 0000000..d08c82f --- /dev/null +++ b/javadoc/index-files/index-17.html @@ -0,0 +1,187 @@ + + + + + + +R-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

R

+
+
raiseNotification() - Method in class lib.DesktopNotify
+
+
Raise a notification
+
+
readEntireFile() - Method in class lib.SimpleFile
+
+
Read bytes from previously opened BufferedReader
+
+
readLine() - Method in class lib.SimpleFile
+
+
Read a single line from a text file
+
+
refreshExitTableModel(String) - Method in class client.NodeList
+
+
Update the table model based on supplied country
+
+
refreshGuardTableModel() - Method in class client.NodeList
+
+
Update the guard node table model
+
+
refreshNodelist(TorController) - Method in class client.NodeList
+
+
Generate the nodelist
+
+
registerWindow() - Static method in class lib.Utilities
+
+
Creates a hidden dummy window for registration to various docks/launchers + Fixes the neverending launching indicator
+
+
renameFile(String) - Method in class lib.SimpleFile
+
 
+
renameTo(File, String) - Static method in class lib.SimpleFile
+
 
+
RESET - Static variable in class client.GuardNodeDialog
+
 
+
RESET - Static variable in class client.PrefsDialog
+
 
+
RESET - Static variable in class client.QuickAddDialog
+
 
+
resetConf(String) - Method in class client.TorController
+
+
reset a tor configuration property
+
+
resetGnome3Pref(String, String) - Static method in class lib.OSFunction
+
+
Reset a gnome3 value to its default.
+
+
resetToDefaults() - Method in class lib.SimpleProps
+
+
Reset to defaults
+
+
restoreProxyPrefs(boolean) - Method in class client.PacFactory
+
+
Generic restore of proxy settings, for ease of use
+
+
retrieveHeader() - Method in class lib.NetFunctions.HttpPage
+
+
Retrieve http header info
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-18.html b/javadoc/index-files/index-18.html new file mode 100644 index 0000000..abd9f96 --- /dev/null +++ b/javadoc/index-files/index-18.html @@ -0,0 +1,701 @@ + + + + + + +S-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

S

+
+
S2KRFC2440(String) - Static method in class lib.Utilities
+
+
Secret to key, Algorithm info taken from + http://sunsite.icm.edu.pl/gnupg/rfc2440-3.html
+
+
save() - Method in class lib.SimpleProps
+
+
Save to xml file
+
+
saveBodyToFile(String, JProgressBar) - Method in class lib.NetFunctions.HttpPage
+
+
Save http body to a file, applies to all types of content
+
+
saveConf() - Method in class client.TorController
+
+
Save configuration file
+
+
saveExitFavourites() - Method in class client.NodeList
+
+
Save exit node whitelist
+
+
saveGuardWhitelist() - Method in class client.NodeList
+
+
Save exit node blacklist
+
+
savePatternsList(String, String, ArrayList<String>) - Method in class client.PacFactory
+
+
Save a patterns list by filename
+
+
savePreferences() - Method in class client.PrefsDialog
+
+
Save preferences
+
+
saveURLContentToFile(String, String, Socket, boolean) - Method in class lib.NetFunctions
+
+
Save the contents of a URL to a file
+
+
secureWipe(String) - Static method in class lib.SimpleFile
+
+
Wipe file using specified filename
+
+
secureWipe(File) - Static method in class lib.SimpleFile
+
+
Wipe file using specified File
+
+
secureWipeFolder(String) - Static method in class lib.SimpleFile
+
+
Wipe folder and its contents using specified folder path
+
+
secureWipeFolder(File) - Static method in class lib.SimpleFile
+
+
Wipe folder and its contents using specified File
+
+
SelekTOR - Class in client
+
 
+
SelekTOR(String[]) - Constructor for class client.SelekTOR
+
+
Initialises SelekTOR UI Frame
+
+
SelekTOR - Class in <Unnamed>
+
+
Explanation of why this is in the default package
+
+
SelekTOR() - Constructor for class SelekTOR
+
 
+
sendCommand(String) - Method in class client.TorController
+
+
Send a command to tor client
+
+
sendMessage(String) - Method in class lib.ClientProcess
+
+
Send a message to the process
+
+
setAckEnabled(boolean) - Method in class lib.InfoDialog
+
+
Set whether Ok button is enabled
+
+
setAckVisible(boolean) - Method in class lib.InfoDialog
+
+
Set whether OK button is visible
+
+
setAppDescription(String) - Method in class lib.AboutDialog
+
+
Set appliction description
+
+
setAppLogo(ImageIcon) - Method in class lib.AboutDialog
+
+
Set application logo
+
+
setApplyText(String) - Method in class client.QuickAddDialog
+
+
Set text that appears on the Apply button
+
+
setAutoClose(int) - Method in class lib.InfoDialog
+
+
Set the form auto close period in milliseconds
+
+
setAutoScrollEnabled(boolean) - Method in class lib.InfoDialog
+
+
Enable/Disable Autoscrolling
+
+
setBackground(Color) - Method in class lib.TrayPopupMenu
+
 
+
setBackupFolder(String) - Method in class client.PacFactory
+
+
Set folder where system proxy settings will be backed up
+
+
setBandwidth(float) - Method in class client.NodeItem
+
+
Set node item bandwidth
+
+
setBool(String, boolean) - Method in class lib.SimpleProps
+
+
Set a boolean property
+
+
setBoolTorOption(String, boolean) - Method in class client.TorProcess
+
+
Add a tor option boolean value
+
+
setBridges(String) - Method in class client.TorProcess
+
+
Set Tor bridges, supports multiple addresses
+
+
setButtonCloseText(String) - Method in class lib.AboutDialog
+
+
Set text on Close button
+
+
setButtonContactText(String) - Method in class lib.AboutDialog
+
+
Set text on Contact button
+
+
setButtonURL(String) - Method in class lib.TextResourceDialog
+
+
Set the browser url for unnoficial translation
+
+
setButtonVisitText(String) - Method in class lib.AboutDialog
+
+
Set text on Visit button
+
+
setCachedDataFolder(int) - Method in class client.TorProcess
+
+
This populates the the current folder whose name is derived from the + listening port with data from the given source folder derived by the + given port number.
+
+
setCancelButtonText(String) - Method in class lib.InfoDialog
+
 
+
setCancelEnabled(boolean) - Method in class lib.InfoDialog
+
+
Set whether Cancel button is enabled
+
+
setCancelVisible(boolean) - Method in class lib.InfoDialog
+
+
Set whether Cancel button is visible
+
+
setCheckBoxEnabled(boolean) - Method in class lib.InfoDialog
+
+
Set check box selection status
+
+
setCheckBoxText(String) - Method in class lib.InfoDialog
+
 
+
setCheckBoxVisible(boolean) - Method in class lib.InfoDialog
+
+
Set whether the forms checkbox is enabled
+
+
setCircuit(String) - Method in class client.TorCircuit
+
+
Set circuit to supplied circuit
+
+
setCircuitHops(String) - Method in class client.NodeItem
+
+
Set circuit hops
+
+
setCLIOption(String, String) - Method in class client.TorProcess
+
+
Add a tor option string which is passed to the tor client on startup.
+
+
setCloseButtonText(String) - Method in class lib.InfoDialog
+
 
+
setCloseButtonText(String) - Method in class lib.TextResourceDialog
+
+
Set the text on the Close button
+
+
setColumnName(String, int) - Method in class client.ExitNodeTableModel
+
+
Set the column name at the specified index
+
+
setColumnName(String, int) - Method in class client.GuardNodeTableModel
+
+
Set the column name at the specified index
+
+
setColumnName(String, int) - Method in class client.PatternsEditor.PACTableModel
+
+
Set the column name at the specified index
+
+
setConf(String) - Method in class client.TorController
+
+
Set a tor configuration property
+
+
setContactURL(String) - Method in class lib.AboutDialog
+
+
Set contact url
+
+
setContinueButtonText(String) - Method in class lib.InfoDialog
+
 
+
setControlPassword(String, String) - Method in class client.TorProcess
+
 
+
setCountryCode(String) - Method in class client.NodeItem
+
+
Set Nodeitem with its two letter country code abbreviation
+
+
setCountryName(String) - Method in class client.NodeItem
+
+
Set Nodeitem with its full country name
+
+
setDefaultModeEnabled(boolean) - Method in class lib.SimpleProps
+
+
Enable/disable default mode
+
+
setDefaultProxy(String) - Method in class client.PacFactory
+
+
Set default proxy url
+
+
setDoNotProxy(String) - Method in class client.PacFactory
+
+
Set do not proxy
+
+
setEnabled(boolean) - Method in class lib.DesktopNotify
+
+
Disable/Enable notifications
+
+
setEntryNodes(String) - Method in class client.TorController
+
+
Set entry nodes
+
+
setExitNodeTableModel(ExitNodeTableModel) - Method in class client.NodeList
+
+
Set the exit node view table model
+
+
setExternalArgs(String) - Method in class client.TorProcess
+
+
Set external user provided startup arguments
+
+
setFavouriteEnabled(boolean) - Method in class client.NodeItem
+
+
Set exit enabled status of Nodeitem
+
+
setFields(String, String) - Method in class client.QuickAddDialog
+
+
Set the test that appears in both fields
+
+
setFile(File) - Method in class lib.SimpleFile
+
+
Set file
+
+
setFileFilter(String) - Method in class lib.SimpleFile
+
+
Sets the file filter
+
+
setFileHidden(String, boolean) - Static method in class lib.OSFunction
+
+
Set a files hidden status (Windows only)
+
+
setFileName(String) - Method in class lib.SimpleFile
+
+
Set filename
+
+
setFingerprint(String) - Method in class client.NodeItem
+
+
Set nodeitem fingerprint
+
+
setFont(String, int) - Method in class lib.InfoDialog
+
+
Set info font
+
+
setForeground(Color) - Method in class lib.TrayPopupMenu
+
 
+
setGeoIP4(String) - Method in class client.TorProcess
+
+
Set the path to the geoip file
+
+
setGeoIP6(String) - Method in class client.TorProcess
+
+
Set the path to the geoip file
+
+
setGnome3Pref(String, String, boolean) - Static method in class lib.OSFunction
+
+
Set a gnome 3 boolean value using schema name and key name
+
+
setGnome3Pref(String, String, String) - Static method in class lib.OSFunction
+
+
Set a gnome 3 string value using schema name and key name
+
+
setGuardEnabled(boolean) - Method in class client.NodeItem
+
+
Set guard enabled status of Nodeitem
+
+
setGuardNodeTableModel(GuardNodeTableModel) - Method in class client.NodeList
+
+
Set the guard node view table model
+
+
setHomeURL(String) - Method in class lib.AboutDialog
+
+
Set home url
+
+
setHops(String) - Method in class client.TorCircuit
+
+
Set hops
+
+
setHttpSupported(boolean) - Method in class client.NodeItem
+
 
+
setInfoText(String) - Method in class lib.InfoDialog
+
+
Set dialog message body
+
+
setInfoText(String, Color) - Method in class lib.InfoDialog
+
+
Set dialog message body, and font colour
+
+
setInfoTip(String) - Method in class lib.SwingTrayIcon
+
+
Set info tip text
+
+
setInitialBootEvent(int) - Method in class client.TorProcess
+
+
Set the event that is issued on process boot completion
+
+
setInt(String, int) - Method in class lib.SimpleProps
+
+
Set a integer number property
+
+
setIPAddress(String) - Method in class client.NodeItem
+
+
Set nodeitem ip address
+
+
setKDEPref(String, String, String) - Static method in class lib.OSFunction
+
+
Set a kde string preference value using group name, key name
+
+
setKDEPref(String, String, boolean) - Static method in class lib.OSFunction
+
+
Set a kde boolean preference value using group name, key name
+
+
setKDEPref(String, String, int) - Static method in class lib.OSFunction
+
+
Set a kde integer preference value using group name, key name
+
+
setLatency(long) - Method in class client.NodeItem
+
+
Set Nodeitem latency value in ms
+
+
setLaunchString(String) - Method in class client.TorMonFrame
+
+
Set launch command text
+
+
setListenPort(int) - Method in class client.TorProcess
+
+
Set the listening port
+
+
setLogLevel(int) - Method in class client.TorProcess
+
+
Set the Tor stdout log level
+
+
setLong(String, long) - Method in class lib.SimpleProps
+
+
Set a long number property
+
+
setMaxHistory(int) - Method in class client.TorProcess
+
+
Set the maximum no of lines to display in the Stdout output
+
+
setNickName(String) - Method in class client.NodeItem
+
+
Set nodeitem name
+
+
setNodeList(NodeList) - Method in class client.GuardNodeDialog
+
+
Set the nodelist
+
+
setNotificationBody(String) - Method in class lib.DesktopNotify
+
+
Set desktop notification body
+
+
setNotificationTitle(String) - Method in class lib.DesktopNotify
+
+
Set desktop notification title
+
+
setOwnershipID(String) - Method in class client.TorProcess
+
+
Set Ownership process id, useful for proper process termination in event + of a crash
+
+
setPACFolder(String) - Method in class client.PacFactory
+
+
Set folder where pac files will be generated
+
+
setPatternsFolder(String) - Method in class client.PacFactory
+
+
Create folder in which pattern files will be stored
+
+
setProgressBar(JProgressBar) - Method in class lib.NetFunctions
+
 
+
setProxyAutoConfigURL(String) - Method in class client.PacFactory
+
+
Generic set proxy config
+
+
setSelectedCountry(String) - Method in class client.PatternsEditor
+
+
Set the selected country
+
+
setSilentBootEnabled(boolean) - Method in class client.TorProcess
+
+
Enable/Disable bootstrap message events on startup
+
+
setSocketTimeout(int) - Method in class lib.NetFunctions
+
+
Set default socket timeout
+
+
setStable(String) - Method in class client.NodeItem
+
+
Set Nodeitem stability yes/no/unknown
+
+
setStartupDelay(long) - Method in class lib.ClientProcess
+
+
Set the initial delay that is executed prior to starting the process
+
+
setStartupTimeout(long) - Method in class lib.ClientProcess
+
+
Set startup timeout
+
+
setStatus(int) - Method in class client.TorController
+
+
Set status flag
+
+
setStdoutTextArea(JTextArea) - Method in class client.TorProcess
+
+
Set the text area that will receive Stdout output
+
+
setStreams(int) - Method in class client.NodeItem
+
+
Set nodeitem number of streams
+
+
setString(String, String) - Method in class lib.SimpleProps
+
+
Set a String property
+
+
setTempFolder(String) - Method in class client.PacFactory
+
+
Set the temp folder for file extractions
+
+
setTestFieldValues(String, long, String, String) - Method in class client.ExitNodeTableModel
+
+
Convenience method to set the testing field cell values for a specific + fingerprint, the hops field is hidden and does npt show up in table
+
+
setTestingMessage(String) - Method in class client.NodeItem
+
+
Set Nodeitem testing status message
+
+
setTestingURL(String) - Method in class client.TorController
+
+
Set the url used for latency checking
+
+
setTestLatency(long) - Method in class client.NodeItem
+
+
Set Nodeitem test latency value in ms
+
+
setTestStatus(int) - Method in class client.NodeItem
+
+
Set testing status flag
+
+
setText(String) - Method in class lib.TextResourceDialog
+
+
Set the license text
+
+
setTimeLock(int) - Method in class lib.InfoDialog
+
 
+
setTitle(String) - Method in class lib.InfoDialog
+
+
Set dialog title
+
+
setTorrcOption(String, String) - Method in class client.TorProcess
+
+
Add a torrc option string See Tor documentation for valid options.
+
+
setTrayPopupMenu(TrayPopupMenu) - Method in class lib.SwingTrayIcon
+
+
Set tray right click popup
+
+
setType(int) - Method in class client.NodeItem
+
+
Set Node type
+
+
setURLButtonText(String) - Method in class lib.TextResourceDialog
+
+
Set the text on the Close button
+
+
setValueAt(Object, String, int) - Method in class client.ExitNodeTableModel
+
+
Set value with given fingerprint at given column
+
+
setValueAt(Object, int, int) - Method in class client.ExitNodeTableModel
+
+
Set cell value at row,col
+
+
setValueAt(Object, String, int) - Method in class client.GuardNodeTableModel
+
+
Set value with given fingerprint at given column
+
+
setValueAt(Object, int, int) - Method in class client.GuardNodeTableModel
+
+
Set cell value at row,col
+
+
setVisibleWithFocus(boolean) - Method in class lib.InfoDialog
+
 
+
signal(String) - Method in class client.TorController
+
+
Send signal to tor
+
+
SimpleFile - Class in lib
+
 
+
SimpleFile() - Constructor for class lib.SimpleFile
+
 
+
SimpleFile(String) - Constructor for class lib.SimpleFile
+
+
Constructor
+
+
SimpleProps - Class in lib
+
 
+
SimpleProps(String, String) - Constructor for class lib.SimpleProps
+
+
Constructor, requires
+
+
start() - Method in class client.TorController
+
+
Start tor controller process and issue the TOR_BOOTED event
+
+
start(int) - Method in class client.TorController
+
+
Start tor controller process and issue the given event
+
+
start(String) - Method in class lib.ClientProcess
+
+
Starts the client process
+
+
startProcess() - Method in class client.TorProcess
+
+
Starts Tor process, and issues booted event on completion
+
+
STATUS_BOOTING - Static variable in class client.TorController
+
 
+
STATUS_CIRCUIT_CREATION - Static variable in class client.TorController
+
 
+
STATUS_DEAD - Static variable in class client.TorController
+
 
+
STATUS_IDLE - Static variable in class client.TorController
+
 
+
STATUS_LATENCY_CHECKING - Static variable in class client.TorController
+
 
+
stop() - Method in class client.TorController
+
+
Stop the tor controller process completely
+
+
stopProcess() - Method in class lib.ClientProcess
+
+
Stops the client process
+
+
STREAM_IP - Static variable in class client.TorController
+
 
+
SwingTrayIcon - Class in lib
+
 
+
SwingTrayIcon(GraphicsConfiguration, String) - Constructor for class lib.SwingTrayIcon
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-19.html b/javadoc/index-files/index-19.html new file mode 100644 index 0000000..a960f62 --- /dev/null +++ b/javadoc/index-files/index-19.html @@ -0,0 +1,228 @@ + + + + + + +T-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

T

+
+
terminate() - Method in class client.NodeList
+
+
Ensures any threaded actions will terminate themselves
+
+
testNode(String) - Method in class client.TorController
+
+
Test specified node, non blocking
+
+
TESTSTATUS_FAILED - Static variable in class client.NodeItem
+
 
+
TESTSTATUS_PASSED - Static variable in class client.NodeItem
+
 
+
TESTSTATUS_UNKNOWN - Static variable in class client.NodeItem
+
 
+
TextResourceDialog - Class in lib
+
 
+
TextResourceDialog(Frame, boolean) - Constructor for class lib.TextResourceDialog
+
+
Creates new License Dialog
+
+
TOR_BOOT_ERROR - Static variable in class client.TorProcess
+
 
+
TOR_BOOT_FATAL - Static variable in class client.TorProcess
+
 
+
TOR_BOOT_TIMEOUT - Static variable in class client.TorProcess
+
 
+
TOR_BOOTED - Static variable in class client.TorProcess
+
 
+
TOR_BRIDGE - Static variable in class client.TorProcess
+
 
+
TOR_CLOCK_ERROR - Static variable in class client.TorProcess
+
 
+
TOR_DIRINFO_STALE - Static variable in class client.TorProcess
+
 
+
TOR_MESSAGE - Static variable in class client.TorProcess
+
 
+
TOR_NEWCIRC - Static variable in class client.TorProcess
+
 
+
TOR_NOEXITS - Static variable in class client.TorProcess
+
 
+
TOR_NOHOP0 - Static variable in class client.TorProcess
+
 
+
TOR_NONET_ACTIVITY - Static variable in class client.TorProcess
+
 
+
TOR_NOROUTE - Static variable in class client.TorProcess
+
 
+
TOR_RESTARTED - Static variable in class client.TorProcess
+
 
+
TOR_STOPPED - Static variable in class client.TorProcess
+
 
+
TorCircuit - Class in client
+
 
+
TorCircuit() - Constructor for class client.TorCircuit
+
+
Constructor
+
+
TorCircuit(String) - Constructor for class client.TorCircuit
+
+
Constructor, Create circuit object with given circuit
+
+
TorController - Class in client
+
 
+
TorController(String, String) - Constructor for class client.TorController
+
+
Constructor
+
+
TorMonFrame - Class in client
+
 
+
TorMonFrame() - Constructor for class client.TorMonFrame
+
+
Creates new form TorMonFrame
+
+
TorProcess - Class in client
+
 
+
TorProcess(String, String) - Constructor for class client.TorProcess
+
+
Constructor
+
+
torProcessEventFired(int, String) - Method in class client.TorController
+
+
Tor process event
+
+
torProcessEventFired(int, String) - Method in class client.TorProcess
+
+
Called if an event was fired, will be overidden by sub class
+
+
toString() - Method in class client.PatternsEditor.PACTableModel
+
+
Returns all data as a single string
+
+
toWebLanguageTag() - Method in class lib.Localisation
+
 
+
TrayPopupMenu - Class in lib
+
 
+
TrayPopupMenu() - Constructor for class lib.TrayPopupMenu
+
 
+
TYPE_EXIT - Static variable in class client.NodeItem
+
 
+
TYPE_GUARD - Static variable in class client.NodeItem
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-2.html b/javadoc/index-files/index-2.html new file mode 100644 index 0000000..e98c0d1 --- /dev/null +++ b/javadoc/index-files/index-2.html @@ -0,0 +1,132 @@ + + + + + + +B-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

B

+
+
backupProxyPrefs() - Method in class client.PacFactory
+
+
Generic backup of proxy settings
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-20.html b/javadoc/index-files/index-20.html new file mode 100644 index 0000000..dd179f5 --- /dev/null +++ b/javadoc/index-files/index-20.html @@ -0,0 +1,138 @@ + + + + + + +U-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

U

+
+
unload() - Method in class lib.SwingTrayIcon
+
+
Unload Tray icon
+
+
Utilities - Class in lib
+
 
+
Utilities() - Constructor for class lib.Utilities
+
+
Constructor
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-21.html b/javadoc/index-files/index-21.html new file mode 100644 index 0000000..2157431 --- /dev/null +++ b/javadoc/index-files/index-21.html @@ -0,0 +1,140 @@ + + + + + + +V-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

V

+
+
validateBridges(String) - Method in class client.TorProcess
+
+
Validate bridge addresses
+
+
validateHostPort(String) - Method in class client.TorProcess
+
+
Validate a host:port ipv4 address
+
+
verifyControlComms() - Method in class client.TorController
+
+
Verify we have comms on the control socket
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-22.html b/javadoc/index-files/index-22.html new file mode 100644 index 0000000..a5b0363 --- /dev/null +++ b/javadoc/index-files/index-22.html @@ -0,0 +1,140 @@ + + + + + + +W-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

W

+
+
walkFileTree(String, ArrayList<File>) - Static method in class lib.SimpleFile
+
 
+
walkFileTree(String, ArrayList<File>, String) - Static method in class lib.SimpleFile
+
 
+
writeFile(String, int) - Method in class lib.SimpleFile
+
+
Write to a previously opened output file
+
+
writeFile(char[], int) - Method in class lib.SimpleFile
+
+
Write to a previously opened output file
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-3.html b/javadoc/index-files/index-3.html new file mode 100644 index 0000000..b061e52 --- /dev/null +++ b/javadoc/index-files/index-3.html @@ -0,0 +1,295 @@ + + + + + + +C-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

C

+
+
CANCEL - Static variable in class client.GuardNodeDialog
+
 
+
CANCEL - Static variable in class client.PatternsEditor
+
 
+
CANCEL - Static variable in class client.PrefsDialog
+
 
+
CANCEL - Static variable in class client.QuickAddDialog
+
 
+
CANCEL_BUTTON - Static variable in class lib.InfoDialog
+
 
+
CANCEL_WINDOW - Static variable in class lib.InfoDialog
+
 
+
cleanupExit() - Method in class client.SelekTOR
+
+
The main application exit routine also does cleanup before exiting
+
+
clear() - Method in class client.ExitNodeTableModel
+
+
Clear the table model of all data
+
+
clear() - Method in class client.GuardNodeTableModel
+
+
Clear the table model of all data
+
+
clearActiveProcesses() - Static method in class lib.OSFunction
+
+
Clear active processes, mainly to reduce memory consumption when were + done with them
+
+
clearBridges() - Method in class client.NodeList
+
+
Clear any learned bridges
+
+
clearCLIOption(String) - Method in class client.TorProcess
+
+
Remove previously add tor option
+
+
clearStdout() - Method in class client.TorProcess
+
+
Clear the Stdout text area
+
+
clearTorrcOption(String) - Method in class client.TorProcess
+
+
Remove previously add torrc option
+
+
clearType() - Method in class client.NodeItem
+
+
Clear node type
+
+
client - package client
+
 
+
CLIENT_RUNNING - Static variable in class lib.ClientProcess
+
 
+
CLIENT_STOPPED - Static variable in class lib.ClientProcess
+
 
+
CLIENT_TIMEDOUT - Static variable in class lib.ClientProcess
+
 
+
ClientProcess - Class in lib
+
 
+
ClientProcess() - Constructor for class lib.ClientProcess
+
+
Constructor
+
+
clientProcessEventFired(String) - Method in class client.TorProcess
+
+
Client event handler, can be overriden by parent class
+
+
clientProcessEventFired(String) - Method in class lib.ClientProcess
+
+
Event from the process, should be overriden by sub class
+
+
clone() - Method in class client.NodeItem
+
 
+
closeCircuit(String) - Method in class client.TorController
+
+
Close a circuit with ID
+
+
closeCircuitsExcept(String, boolean) - Method in class client.TorController
+
+
Close open circuits except circuit specified by id
+
+
closeFile() - Method in class lib.SimpleFile
+
+
Close file and any resources such as buffered readers/writers that are + attached to it.
+
+
closeZipStream() - Method in class lib.SimpleFile
+
+
Close a zip stream
+
+
compress(String, String) - Static method in class lib.SimpleFile
+
 
+
CONNECTION_FAILED - Static variable in class lib.NetFunctions
+
 
+
controllerEventFired(int, Object) - Method in class client.TorController
+
+
Handle for controllerEventFired should be overridden by parent class
+
+
copyFolderContents(String, String, String) - Static method in class lib.SimpleFile
+
+
Copy multiple files from one folder to another
+
+
copyFromTo(String, String) - Static method in class lib.SimpleFile
+
+
Copy file to
+
+
createDataFolder() - Method in class client.TorProcess
+
+
Creates a data folder for the Tor client to put its cache data
+
+
createDefaultConfig() - Method in class client.TorProcess
+
+
Creates the default Tor config file
+
+
createError(String) - Method in class lib.InfoDialog
+
+
Create error dialog
+
+
createError(String, String) - Method in class lib.InfoDialog
+
+
Create error dialog
+
+
createFile() - Method in class lib.SimpleFile
+
+
Create a new file
+
+
createFolder() - Method in class lib.SimpleFile
+
+
Creates a new folder
+
+
createFolder(String) - Static method in class lib.SimpleFile
+
+
Creates a new folder
+
+
createInfo(String) - Method in class lib.InfoDialog
+
+
Convenience methods
+
+
createInfo(String, String) - Method in class lib.InfoDialog
+
 
+
createPacFile(String, int) - Method in class client.PacFactory
+
+
Create and/or activate a pacfile for a specific country
+
+
createProgress(String, String) - Method in class lib.InfoDialog
+
+
Create progress bar dialog
+
+
createSocks4aSocket(String, int, String, int) - Method in class client.TorController
+
+
Create a Socks4a socket Taken from Wikipedia SOCKS4a is a simple + extension to SOCKS4 protocol that allows a client that cannot resolve the + destination host's domain name to specify it.
+
+
createTorSocketToURL(String, boolean) - Method in class client.TorController
+
+
Create a socks4a socket to this URL on this tor connection, if nowww is + true then remove www.
+
+
createWarn(String) - Method in class lib.InfoDialog
+
 
+
createWarn(String, String) - Method in class lib.InfoDialog
+
+
Create warning dialog
+
+
CustomTableCellRenderer() - Constructor for class client.PatternsEditor.CustomTableCellRenderer
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-4.html b/javadoc/index-files/index-4.html new file mode 100644 index 0000000..5a5767a --- /dev/null +++ b/javadoc/index-files/index-4.html @@ -0,0 +1,192 @@ + + + + + + +D-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

D

+
+
delete() - Method in class lib.SimpleFile
+
+
Deletes file
+
+
delete(String) - Static method in class lib.SimpleFile
+
+
Deletes the specified file
+
+
delete() - Method in class lib.SimpleProps
+
+
Delete the properties file store
+
+
deleteAllPAC() - Method in class client.PacFactory
+
+
Delete all pac files
+
+
deleteCacheData() - Method in class client.TorProcess
+
+
Delete Tor cache data
+
+
deleteConfigFile() - Method in class client.TorProcess
+
+
Delete the configuration file
+
+
deleteFileList(File[]) - Method in class lib.SimpleFile
+
+
Deletes the supplied list of files, be very carefull with this
+
+
deleteFolder(String) - Static method in class lib.SimpleFile
+
+
Delete folder and its contents using specified folder path
+
+
deletePAC(String) - Method in class client.PacFactory
+
+
Delete specified pac file
+
+
deletePatternsFile(String, String) - Method in class client.PacFactory
+
+
Delete patterns file for a given country and type, where type is either + "def" or "user"
+
+
deleteProxyPrefs() - Method in class client.PacFactory
+
+
Generic proxy prefs delete, for ease of use
+
+
DesktopNotify - Class in lib
+
+
This class handles desktop notifications
+
+
DesktopNotify(SwingTrayIcon, String) - Constructor for class lib.DesktopNotify
+
 
+
disable() - Method in class lib.SwingTrayIcon
+
 
+
displayMessage(String, String) - Method in class lib.SwingTrayIcon
+
+
Display desktop message (Windows only)
+
+
dispose() - Method in class lib.SwingTrayIcon
+
 
+
doLatencyCheck(int) - Method in class client.TorController
+
+
Triggers a socks latency check, EVENT_LATENCY_CHECK is fired on + completion
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-5.html b/javadoc/index-files/index-5.html new file mode 100644 index 0000000..32461e8 --- /dev/null +++ b/javadoc/index-files/index-5.html @@ -0,0 +1,190 @@ + + + + + + +E-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

E

+
+
editFile(String) - Static method in class lib.Utilities
+
+
Open the desktop default file editor
+
+
EMPTYSTRING - Static variable in class client.TorProcess
+
 
+
enablePredictiveCircuits(boolean) - Method in class client.TorController
+
+
Enable/Disable predictive circuit building
+
+
EVENT_ABORTED - Static variable in class client.TorController
+
 
+
EVENT_CIRCUIT_BUILT - Static variable in class client.TorController
+
 
+
EVENT_CIRCUIT_CHANGED - Static variable in class client.TorController
+
 
+
EVENT_CIRCUIT_FAILED - Static variable in class client.TorController
+
 
+
EVENT_CIRCUITS_BUILT - Static variable in class client.TorController
+
 
+
EVENT_CIRCUITS_FAILED - Static variable in class client.TorController
+
 
+
EVENT_LATENCY_DONE - Static variable in class client.TorController
+
 
+
EVENT_NETLATENCY - Static variable in class lib.NetFunctions
+
 
+
EVENT_TESTING_DONE - Static variable in class client.TorController
+
 
+
EVENT_URLFAILED - Static variable in class lib.NetFunctions
+
 
+
EVENT_URLOK - Static variable in class lib.NetFunctions
+
 
+
exists() - Method in class lib.SimpleFile
+
+
Test to see if path exists
+
+
exists(String) - Static method in class lib.SimpleFile
+
+
Test to see if path exists
+
+
ExitNodeTableModel - Class in client
+
 
+
ExitNodeTableModel() - Constructor for class client.ExitNodeTableModel
+
 
+
exportUserPatterns(String, File[]) - Method in class client.PacFactory
+
+
Export user patterns
+
+
ExtensionFileFilter - Class in lib
+
 
+
ExtensionFileFilter(String, String) - Constructor for class lib.ExtensionFileFilter
+
+
Convenience constructor for a single extension
+
+
ExtensionFileFilter(String, String[]) - Constructor for class lib.ExtensionFileFilter
+
+
Convenience constructor for a multiple extensions
+
+
extractZipTo(String) - Method in class lib.SimpleFile
+
+
Extracts a zip file to a supplied location
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-6.html b/javadoc/index-files/index-6.html new file mode 100644 index 0000000..965fd54 --- /dev/null +++ b/javadoc/index-files/index-6.html @@ -0,0 +1,178 @@ + + + + + + +F-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

F

+
+
FILE_FAILED - Static variable in class lib.NetFunctions
+
 
+
FILE_LOCAL_ISNEWER - Static variable in class lib.NetFunctions
+
 
+
FILE_RETRIEVED - Static variable in class lib.NetFunctions
+
 
+
FILEDELETEFAIL - Static variable in class lib.SimpleFile
+
 
+
FILEDELETEOK - Static variable in class lib.SimpleFile
+
 
+
FILEUSER - Static variable in class client.PacFactory
+
 
+
filterProcesses(ArrayList<String>, String) - Static method in class lib.OSFunction
+
+
Find processes matching the contents of filter
+
+
filterProcesses(String) - Static method in class lib.OSFunction
+
+
Find processes matching the contents of filter
+
+
filterRouterInfo(ArrayList<String>, String) - Method in class client.NodeList
+
 
+
findFile(String, String...) - Static method in class lib.OSFunction
+
+
Find a specific file, requires a series of paths where it might be found + to be provided
+
+
FINGER - Static variable in class client.TorCircuit
+
 
+
fixJMenuPopupBorder(JMenu...) - Static method in class lib.GTKFixes
+
+
Fixes incorrect JMenu border outline
+
+
fixMenubarHeight(JMenuBar, JMenuItem) - Static method in class lib.GTKFixes
+
 
+
fixMenuItemFgColor(JMenuItem...) - Static method in class lib.GTKFixes
+
+
Fixes incorrect JMenu selectionForeground highlighting
+
+
fixMenuSelectionColor(JMenu...) - Static method in class lib.GTKFixes
+
+
Fixes incorrect JMenu selectionForeground and selectionBackground + highlighting
+
+
fixTextAreaColor(JTextArea) - Static method in class lib.GTKFixes
+
 
+
fixTrayMenuPopupBorder(TrayPopupMenu) - Static method in class lib.GTKFixes
+
 
+
flushWriter() - Method in class lib.SimpleFile
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-7.html b/javadoc/index-files/index-7.html new file mode 100644 index 0000000..a150e94 --- /dev/null +++ b/javadoc/index-files/index-7.html @@ -0,0 +1,731 @@ + + + + + + +G-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

G

+
+
generateSecretKey(int) - Static method in class lib.Utilities
+
+
Generate secret key.
+
+
getActiveCountry() - Method in class client.PacFactory
+
+
Get the active country code
+
+
getActiveDesktop() - Static method in class lib.OSFunction
+
+
Get the name of the active desktop
+
+
getActiveStreams() - Method in class client.TorController
+
+
Get list of active streams
+
+
getAgeOfFile(String, int) - Static method in class lib.SimpleFile
+
+
Get the age of a specified file
+
+
getAppSettingsPath(String, String) - Static method in class lib.OSFunction
+
+
Get a specified application's settings folder, if null return this + applications setting folder
+
+
getBandwidth() - Method in class client.NodeItem
+
+
Get nodeitem bandwith
+
+
getBestHops() - Method in class client.TorController
+
+
Get best hops
+
+
getBestLatency() - Method in class client.TorController
+
+
Get best latency
+
+
getBodyAsString() - Method in class lib.NetFunctions.HttpPage
+
+
Retrieve http body as string should only be used with text content
+
+
getBool(String) - Method in class lib.SimpleProps
+
+
Get a boolean property
+
+
getBridges() - Method in class client.TorProcess
+
+
Get bridges
+
+
getBuildFlags() - Method in class client.TorCircuit
+
+
Get current circuits build flags
+
+
getBuiltCircuits(boolean) - Method in class client.TorController
+
+
Get built circuits
+
+
getCacheAge() - Method in class client.TorProcess
+
+
Get the age of the file cache in minutes
+
+
getCachedDataFolder() - Method in class client.TorProcess
+
+
Get the currently set cached data folder
+
+
getCachedProcesses() - Static method in class lib.OSFunction
+
+
Cached list of processes
+
+
getChangedProperties() - Method in class lib.SimpleProps
+
+
Get a comma separated list of properties that were changed
+
+
getCircuit() - Method in class client.TorCircuit
+
+
Get circuit
+
+
getCircuitHops() - Method in class client.NodeItem
+
+
Get circuit hops
+
+
getClientLocation() - Method in class client.TorProcess
+
+
Get Tor client location as a filepath
+
+
getClientStatus() - Method in class lib.ClientProcess
+
 
+
getCLIOptionBool(String) - Method in class client.TorProcess
+
+
Get a previously added tor option boolean value
+
+
getCLIOptions(String) - Method in class client.TorProcess
+
+
Get a previously added tor option string
+
+
getCLIOptionsAsString() - Method in class client.TorProcess
+
+
Gets all the currently set tor options as single String for use as + arguments passed to tor client
+
+
getColumnClass(int) - Method in class client.ExitNodeTableModel
+
+
Get column class at given index
+
+
getColumnClass(int) - Method in class client.GuardNodeTableModel
+
+
Get column class at given index
+
+
getColumnClass(int) - Method in class client.PatternsEditor.PACTableModel
+
+
Get column class
+
+
getColumnCount() - Method in class client.ExitNodeTableModel
+
+
Get the number of columns
+
+
getColumnCount() - Method in class client.GuardNodeTableModel
+
+
Get the number of columns
+
+
getColumnCount() - Method in class client.PatternsEditor.PACTableModel
+
+
Get column count as integer
+
+
getColumnName(int) - Method in class client.ExitNodeTableModel
+
+
Get column name at given index
+
+
getColumnName(int) - Method in class client.GuardNodeTableModel
+
+
Get column name at given index
+
+
getColumnName(int) - Method in class client.PatternsEditor.PACTableModel
+
+
Get column name at given index
+
+
getCompositor() - Static method in class lib.OSFunction
+
+
Get the name of the compositor
+
+
getConfigFilePath() - Method in class client.TorProcess
+
+
Get the path to the configuration file
+
+
getControlPort() - Method in class client.TorProcess
+
+
Get the control port
+
+
getCountryCode() - Method in class client.NodeItem
+
+
Get nodeitem two letter country code abbreviation
+
+
getCountryFromIP(String) - Method in class client.TorController
+
+
Attempts to return the Country associated with an ip address
+
+
getCountryName() - Method in class client.NodeItem
+
+
Get nodeitem full country name
+
+
getCurrentStatus() - Method in class client.NodeList
+
+
Get the process status
+
+
getDataFolder() - Method in class client.TorProcess
+
+
Get the datafolder being used by tor client
+
+
getDescription() - Method in class client.QuickAddDialog
+
+
Get contents of description field
+
+
getDescription() - Method in class lib.ExtensionFileFilter
+
+
Get description
+
+
getDisplayCountry(String) - Method in class lib.Localisation
+
+
Get the country name for supplied iso2 code
+
+
getDoNotProxy() - Method in class client.PacFactory
+
+
Get value of comma separated host or ip list
+
+
getEnabledCount() - Method in class client.GuardNodeTableModel
+
 
+
getEntryGuardsAsCSV() - Method in class client.TorController
+
+
Get entry guards chosen by tor client
+
+
getEntryNodes() - Method in class client.TorController
+
+
Get configured entry nodes
+
+
getEventMessage(int) - Method in class client.TorController
+
 
+
getEventMessage(int) - Method in class client.TorProcess
+
+
Get textual representation on an event
+
+
getExit(int) - Method in class client.TorCircuit
+
+
Get Exitnode
+
+
getExitHop() - Method in class client.TorCircuit
+
+
Get current circuits exit node
+
+
getExitNodes(boolean, boolean) - Method in class client.NodeList
+
+
Get a list of exitnodes, if all is false then it returns only favourited + nodes, if omitfailednodes is true then don't include nodes that failed + testing
+
+
getExitNodesAsString(boolean, boolean) - Method in class client.NodeList
+
+
Get a string of comma separated exitnodes, if all is false then it + returns only favourited nodes, if omitfailednodes is true then don't + include nodes that failed testing
+
+
getExpires() - Method in class lib.NetFunctions.HttpPage
+
 
+
getFile() - Method in class lib.SimpleFile
+
+
Get file
+
+
getFileFilter() - Method in class lib.SimpleFile
+
+
Gets the current file filter
+
+
getFileList() - Method in class lib.SimpleFile
+
+
Gets the file list at the specified directory location based on filter + contents
+
+
getFilenames(int) - Method in class lib.SimpleFile
+
+
Returns an array of filenames, array if populated from the offset value + onwards
+
+
getFileSeparator() - Static method in class lib.OSFunction
+
+
Get file separator
+
+
getFingerprint() - Method in class client.NodeItem
+
+
Get nodeitems fingerprint
+
+
getFont() - Method in class lib.InfoDialog
+
 
+
getFromNodeHop(String, int) - Static method in class client.TorCircuit
+
+
Get fingerprint of given node Nodeinfo is in the format of + fingerprint~name or fingerprint=name
+
+
getGnome3Pref(String, String) - Static method in class lib.OSFunction
+
+
Get gnome 3 preference using schema name and key name
+
+
getGsettingsPath() - Static method in class lib.OSFunction
+
+
Test if gsettings installed (Linux only)
+
+
getGuard(int) - Method in class client.TorCircuit
+
+
Get Guardnode finger or nick
+
+
getGuardFavouritesAsCSV() - Method in class client.NodeList
+
+
Get guard favourites
+
+
getGuardHop() - Method in class client.TorCircuit
+
+
Get current circuits guard or entry node
+
+
getGuardNodes() - Method in class client.NodeList
+
+
Get a list of all guard nodes guard nodes
+
+
getHops() - Method in class client.TorCircuit
+
+
Get circuit hops
+
+
getID() - Method in class client.TorCircuit
+
+
Get current circuit ID
+
+
getInfo(String) - Method in class client.TorController
+
+
Get tor status information for a given property.
+
+
getInt(String) - Method in class lib.SimpleProps
+
+
Get an integer number property
+
+
getIPAddress() - Method in class client.NodeItem
+
+
Get nodeitem ip address
+
+
getKDEPref(String, String, String) - Static method in class lib.OSFunction
+
+
Get a kde preference string value using group name, key name and return + contents of def on failure
+
+
getKDEProxyPath() - Static method in class lib.OSFunction
+
+
Test for KDE installed (Linux only)
+
+
getLangCode() - Static method in class lib.OSFunction
+
+
Get default language iso code
+
+
getLastModified() - Method in class lib.NetFunctions.HttpPage
+
 
+
getLatency() - Method in class client.NodeItem
+
+
Get Nodeitem latency in ms
+
+
getLatency() - Method in class client.TorController
+
+
Get current latency
+
+
getLatency(String, Proxy, int) - Method in class lib.NetFunctions
+
+
Get latency non threaded version
+
+
getLatestCircuit() - Method in class client.TorController
+
+
Get the latest circuit
+
+
getListAsCSV(ArrayList<String>) - Static method in class lib.Utilities
+
+
Covert list to csv
+
+
getListenPort() - Method in class client.TorProcess
+
+
Get the listening port
+
+
getLiveProcesses() - Static method in class lib.OSFunction
+
+
Gets list of active system processes
+
+
getLocale() - Method in class lib.Localisation
+
+
Get the locale
+
+
getLong(String) - Method in class lib.SimpleProps
+
+
Get a long number property
+
+
getMiddleHop() - Method in class client.TorCircuit
+
+
Get current circuits middle node if any, returns exit node for a two hop + circuit
+
+
getMiddleMan(int) - Method in class client.TorCircuit
+
+
Get Middleman
+
+
getNickName() - Method in class client.NodeItem
+
+
Get nodeitem unique name
+
+
getNode(String) - Method in class client.NodeList
+
+
Get node item from its fingerprint
+
+
getNodeItemAt(int) - Method in class client.ExitNodeTableModel
+
+
Get row nodeitem
+
+
getNotifySendPath() - Method in class lib.DesktopNotify
+
 
+
getNumberOfFavs() - Method in class client.NodeList
+
+
Get the number of active favourites
+
+
getOldestFile() - Method in class lib.SimpleFile
+
 
+
getOSArch() - Static method in class lib.OSFunction
+
+
Get OS architecture, convenience method
+
+
getOSName() - Static method in class lib.OSFunction
+
+
Get OS name, convenience method
+
+
getOSVersion() - Static method in class lib.OSFunction
+
+
Get OS version
+
+
getOurProcessID() - Static method in class lib.OSFunction
+
+
Get process id
+
+
getOwnershipID() - Method in class client.TorProcess
+
+
Return the currently set process ownership ID
+
+
getPattern() - Method in class client.QuickAddDialog
+
+
Get contents of the pattern field
+
+
getPatternsFiles() - Method in class client.PacFactory
+
+
Get an array of user pattern files
+
+
getProcess() - Method in class lib.ClientProcess
+
+
Return the client system process
+
+
getProcessID(String) - Static method in class lib.OSFunction
+
+
Get process id from a process
+
+
getProcessOutput(InputStream) - Static method in class lib.OSFunction
+
+
Obtain all output of an executed process.
+
+
getProcessResult(Process) - Static method in class lib.OSFunction
+
+
Convenience method to get the first resultant output of an executed + process as a String
+
+
getProperty(String) - Method in class lib.NetFunctions.HttpPage
+
+
Get various properties of the web page
+
+
getPurpose() - Method in class client.TorCircuit
+
+
Get current circuits purpose
+
+
getReturnStatus() - Method in class client.GuardNodeDialog
+
 
+
getReturnStatus() - Method in class client.PatternsEditor
+
 
+
getReturnStatus() - Method in class client.PrefsDialog
+
 
+
getReturnStatus() - Method in class client.QuickAddDialog
+
 
+
getReturnStatus() - Method in class lib.InfoDialog
+
 
+
getRouterDesc(String) - Method in class client.NodeList
+
 
+
getRouterStatus(String) - Method in class client.NodeList
+
 
+
getSecret() - Method in class client.TorProcess
+
+
Get the currently set authentification secret
+
+
getSeparator() - Static method in class lib.SimpleFile
+
 
+
getServerDate() - Method in class lib.NetFunctions.HttpPage
+
 
+
getSha1Sum(String) - Static method in class lib.Utilities
+
+
Calculate the sha1 checksum of a given file
+
+
getSHAHash(String) - Static method in class lib.Utilities
+
+
Get SHAHash using given password string
+
+
getStability() - Method in class client.NodeItem
+
+
Get Nodeitem stability
+
+
getStatus() - Method in class client.TorCircuit
+
+
Get current circuit status
+
+
getStatus() - Method in class client.TorController
+
+
Get current status
+
+
getStdoutTextArea() - Method in class client.TorMonFrame
+
 
+
getStreams() - Method in class client.NodeItem
+
+
Get nodeitems active streams
+
+
getString(String) - Method in class lib.Localisation
+
+
Get localised string using given key
+
+
getString(String) - Method in class lib.SimpleProps
+
+
Get a String property
+
+
getStrings(String...) - Method in class lib.Localisation
+
+
Get an array of localised strings using a key array or multiple keys
+
+
getTableCellRendererComponent(JTable, Object, boolean, boolean, int, int) - Method in class client.PatternsEditor.CustomTableCellRenderer
+
 
+
getTempFolder(String) - Static method in class lib.OSFunction
+
+
Get users temp folder
+
+
getTestingMessage() - Method in class client.NodeItem
+
+
Get Node item status
+
+
getTestLatency() - Method in class client.NodeItem
+
+
Get Nodeitem test latency in ms
+
+
getTestStatus() - Method in class client.NodeItem
+
+
Get testing status flag
+
+
getText() - Method in class lib.TextResourceDialog
+
+
Get the license text
+
+
getTextArea() - Method in class lib.InfoDialog
+
 
+
getTextFromFile(String) - Static method in class lib.Utilities
+
+
Retrieve text from a text file
+
+
getTextFromResource(String) - Static method in class lib.Utilities
+
+
Retrieve text from a resource text file
+
+
getTimestamp() - Method in class client.TorCircuit
+
+
Get current circuits timestamp
+
+
getTorHashPassword(String) - Static method in class lib.Utilities
+
 
+
getTorLatency(int) - Method in class client.TorController
+
+
Returns measured latency for the active circuit without creating a + stream, this blocks so be careful
+
+
getTorrcOption(String) - Method in class client.TorProcess
+
+
Get a previously added tor option string
+
+
getTorrcOptionsAsString() - Method in class client.TorProcess
+
+
Gets all the currently set torrc options as single String
+
+
getURLContentAsString(String, Socket) - Method in class lib.NetFunctions
+
+
Check web for updates and return version string if an update is available
+
+
getUserName() - Static method in class lib.OSFunction
+
+
Get user name
+
+
getUsersCurrentFolder() - Static method in class lib.OSFunction
+
+
Get users current folder
+
+
getUsersDocFolder() - Static method in class lib.OSFunction
+
+
Get users documents folder (Windows only)
+
+
getUserSettingsPath() - Static method in class lib.OSFunction
+
+
Get user settings path
+
+
getUsersHomeFolder() - Static method in class lib.OSFunction
+
+
Get users home folder
+
+
getValidatedCountries() - Method in class client.NodeList
+
+
Gets validated countries, a valid country is any country with active exit + nodes
+
+
getValidatedCountryCodes() - Method in class client.NodeList
+
+
Gets validated country codes, a valid country is any country with active + exit nodes
+
+
getValueAt(int, int) - Method in class client.ExitNodeTableModel
+
+
Get cell value as object at row,col
+
+
getValueAt(int, int) - Method in class client.GuardNodeTableModel
+
+
Get cell value as object at row,col
+
+
getVersion() - Method in class client.TorProcess
+
+
Get Tor version as float
+
+
GTKFixes - Class in lib
+
 
+
GTKFixes() - Constructor for class lib.GTKFixes
+
 
+
GuardNodeDialog - Class in client
+
 
+
GuardNodeDialog(Frame, boolean) - Constructor for class client.GuardNodeDialog
+
+
Creates new form GuardNodeDialog
+
+
GuardNodeTableModel - Class in client
+
 
+
GuardNodeTableModel() - Constructor for class client.GuardNodeTableModel
+
 
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-8.html b/javadoc/index-files/index-8.html new file mode 100644 index 0000000..e11f86b --- /dev/null +++ b/javadoc/index-files/index-8.html @@ -0,0 +1,134 @@ + + + + + + +H-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

H

+
+
haveValidEntryNode() - Method in class client.TorController
+
 
+
HttpPage(InputStream) - Constructor for class lib.NetFunctions.HttpPage
+
+
Store webpage from the given input stream
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index-files/index-9.html b/javadoc/index-files/index-9.html new file mode 100644 index 0000000..de841bc --- /dev/null +++ b/javadoc/index-files/index-9.html @@ -0,0 +1,242 @@ + + + + + + +I-Index (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
A B C D E F G H I K L M N O P Q R S T U V W  + + +

I

+
+
importPatterns(String) - Method in class client.PacFactory
+
+
Import patterns
+
+
InfoDialog - Class in lib
+
 
+
InfoDialog(Frame) - Constructor for class lib.InfoDialog
+
+
Creates new InfoDialog, for parent frame with modality modal
+
+
isCellEditable(int, int) - Method in class client.ExitNodeTableModel
+
+
Test if the cell is editable
+
+
isCellEditable(int, int) - Method in class client.GuardNodeTableModel
+
+
Test if the cell is editable
+
+
isCellEditable(int, int) - Method in class client.PatternsEditor.PACTableModel
+
+
Test if cell at given row, col is editable
+
+
isCheckBoxSelected() - Method in class lib.InfoDialog
+
+
Test to see if checkbox is selected
+
+
isDaysOlder(String, long) - Static method in class lib.SimpleFile
+
+
Test to see our file is older in days, returns true if it is
+
+
isEnabled() - Method in class lib.DesktopNotify
+
+
Are notifications enabled
+
+
isExit() - Method in class client.NodeItem
+
+
Is exit node
+
+
isFavourite() - Method in class client.NodeItem
+
+
Get exit enabled status of Nodeitem
+
+
isGuard() - Method in class client.NodeItem
+
+
Is Guard node
+
+
isGuardEnabled() - Method in class client.NodeItem
+
+
Get guard enabled status of Nodeitem
+
+
isHeaderOK() - Method in class lib.NetFunctions.HttpPage
+
 
+
isHoursOlder(String, long) - Static method in class lib.SimpleFile
+
+
Test to see our file is older in hours, returns true if it is
+
+
isHttpSupported() - Method in class client.NodeItem
+
 
+
isIdle() - Method in class client.TorController
+
+
Convenience test for idle status
+
+
isIPAddress(String) - Method in class lib.NetFunctions
+
+
Make sure ipaddress is valid number
+
+
isLinux() - Static method in class lib.OSFunction
+
+
Generic test for Linux platform
+
+
isLoaded() - Method in class lib.SwingTrayIcon
+
+
Is tray icon loaded
+
+
isMinutesOlder(String, long) - Static method in class lib.SimpleFile
+
+
Test to see our file is older in minutes, returns true if it is
+
+
isMultipleInstance(String) - Static method in class lib.OSFunction
+
+
Test to see if their are multiple instances of the this app running
+
+
isNewerVersion(String, String) - Static method in class lib.Utilities
+
+
Check for newer appversion
+
+
isNonUnique() - Method in class client.NodeItem
+
 
+
isSupported() - Method in class lib.DesktopNotify
+
+
Is notifications supported
+
+
isSupported() - Method in class lib.SwingTrayIcon
+
 
+
isWin10() - Static method in class lib.OSFunction
+
+
Specific test for Win 10
+
+
isWin7() - Static method in class lib.OSFunction
+
+
Specific test for Win 7
+
+
isWin8() - Static method in class lib.OSFunction
+
+
Specific test for Win 8
+
+
isWindows() - Static method in class lib.OSFunction
+
+
Generic test for Windows platform
+
+
isWinXP() - Static method in class lib.OSFunction
+
+
Specific test for Win XP
+
+
+A B C D E F G H I K L M N O P Q R S T U V W 
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/index.html b/javadoc/index.html new file mode 100644 index 0000000..403ada1 --- /dev/null +++ b/javadoc/index.html @@ -0,0 +1,76 @@ + + + + + + +SelekTOR Java Documentation + + + + + + + + + +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<h2>Frame Alert</h2> +<p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> + + + diff --git a/javadoc/lib/AboutDialog.html b/javadoc/lib/AboutDialog.html new file mode 100644 index 0000000..6cd1359 --- /dev/null +++ b/javadoc/lib/AboutDialog.html @@ -0,0 +1,565 @@ + + + + + + +AboutDialog (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class AboutDialog

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • java.awt.Window
        • +
        • +
            +
          • java.awt.Dialog
          • +
          • +
              +
            • javax.swing.JDialog
            • +
            • +
                +
              • lib.AboutDialog
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    +
    +
    +
    +
    public class AboutDialog
    +extends javax.swing.JDialog
    +
    +
    Author:
    +
    Alistair Neil,
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JDialog

        +javax.swing.JDialog.AccessibleJDialog
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Dialog

        +java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Window

        +java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javax.swing.JDialog

        +accessibleContext, rootPane, rootPaneCheckingEnabled
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Dialog

        +DEFAULT_MODALITY_TYPE
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface javax.swing.WindowConstants

        +DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      AboutDialog(java.awt.Frame parent, + boolean modal) +
      Creates new About Dialog
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidsetAppDescription(java.lang.String text) +
      Set appliction description
      +
      voidsetAppLogo(javax.swing.ImageIcon ii) +
      Set application logo
      +
      voidsetButtonCloseText(java.lang.String text) +
      Set text on Close button
      +
      voidsetButtonContactText(java.lang.String text) +
      Set text on Contact button
      +
      voidsetButtonVisitText(java.lang.String text) +
      Set text on Visit button
      +
      voidsetContactURL(java.lang.String contact) +
      Set contact url
      +
      voidsetHomeURL(java.lang.String home) +
      Set home url
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JDialog

        +addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Dialog

        +addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Window

        +addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        AboutDialog

        +
        public AboutDialog(java.awt.Frame parent,
        +                   boolean modal)
        +
        Creates new About Dialog
        +
        +
        Parameters:
        +
        parent -
        +
        modal -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setAppDescription

        +
        public void setAppDescription(java.lang.String text)
        +
        Set appliction description
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        setAppLogo

        +
        public void setAppLogo(javax.swing.ImageIcon ii)
        +
        Set application logo
        +
        +
        Parameters:
        +
        ii -
        +
        +
      • +
      + + + +
        +
      • +

        setHomeURL

        +
        public void setHomeURL(java.lang.String home)
        +
        Set home url
        +
        +
        Parameters:
        +
        home -
        +
        +
      • +
      + + + +
        +
      • +

        setContactURL

        +
        public void setContactURL(java.lang.String contact)
        +
        Set contact url
        +
        +
        Parameters:
        +
        contact -
        +
        +
      • +
      + + + +
        +
      • +

        setButtonContactText

        +
        public void setButtonContactText(java.lang.String text)
        +
        Set text on Contact button
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        setButtonVisitText

        +
        public void setButtonVisitText(java.lang.String text)
        +
        Set text on Visit button
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        setButtonCloseText

        +
        public void setButtonCloseText(java.lang.String text)
        +
        Set text on Close button
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/ClientProcess.html b/javadoc/lib/ClientProcess.html new file mode 100644 index 0000000..62f6729 --- /dev/null +++ b/javadoc/lib/ClientProcess.html @@ -0,0 +1,493 @@ + + + + + + +ClientProcess (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class ClientProcess

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.ClientProcess
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    TorProcess
    +
    +
    +
    +
    public class ClientProcess
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      ClientProcess() +
      Constructor
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidclientProcessEventFired(java.lang.String data) +
      Event from the process, should be overriden by sub class
      +
      intgetClientStatus() 
      java.lang.ProcessgetProcess() +
      Return the client system process
      +
      voidsendMessage(java.lang.String message) +
      Send a message to the process
      +
      voidsetStartupDelay(long ms) +
      Set the initial delay that is executed prior to starting the process
      +
      voidsetStartupTimeout(long seconds) +
      Set startup timeout
      +
      voidstart(java.lang.String processpath) +
      Starts the client process
      +
      voidstopProcess() +
      Stops the client process
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ClientProcess

        +
        public ClientProcess()
        +
        Constructor
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setStartupDelay

        +
        public final void setStartupDelay(long ms)
        +
        Set the initial delay that is executed prior to starting the process
        +
        +
        Parameters:
        +
        ms -
        +
        +
      • +
      + + + +
        +
      • +

        setStartupTimeout

        +
        public final void setStartupTimeout(long seconds)
        +
        Set startup timeout
        +
        +
        Parameters:
        +
        seconds -
        +
        +
      • +
      + + + +
        +
      • +

        start

        +
        public final void start(java.lang.String processpath)
        +
        Starts the client process
        +
        +
        Parameters:
        +
        processpath -
        +
        +
      • +
      + + + +
        +
      • +

        getClientStatus

        +
        public final int getClientStatus()
        +
      • +
      + + + +
        +
      • +

        getProcess

        +
        public final java.lang.Process getProcess()
        +
        Return the client system process
        +
        +
        Returns:
        +
        a process
        +
        +
      • +
      + + + +
        +
      • +

        stopProcess

        +
        public final void stopProcess()
        +
        Stops the client process
        +
      • +
      + + + +
        +
      • +

        sendMessage

        +
        public final void sendMessage(java.lang.String message)
        +
        Send a message to the process
        +
        +
        Parameters:
        +
        message -
        +
        +
      • +
      + + + +
        +
      • +

        clientProcessEventFired

        +
        public void clientProcessEventFired(java.lang.String data)
        +
        Event from the process, should be overriden by sub class
        +
        +
        Parameters:
        +
        data -
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/DesktopNotify.html b/javadoc/lib/DesktopNotify.html new file mode 100644 index 0000000..987c3a9 --- /dev/null +++ b/javadoc/lib/DesktopNotify.html @@ -0,0 +1,395 @@ + + + + + + +DesktopNotify (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class DesktopNotify

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.DesktopNotify
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class DesktopNotify
    +extends java.lang.Object
    +
    This class handles desktop notifications
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      DesktopNotify(SwingTrayIcon sti, + java.lang.String iconpath) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringgetNotifySendPath() 
      booleanisEnabled() +
      Are notifications enabled
      +
      booleanisSupported() +
      Is notifications supported
      +
      voidraiseNotification() +
      Raise a notification
      +
      voidsetEnabled(boolean enabled) +
      Disable/Enable notifications
      +
      voidsetNotificationBody(java.lang.String text) +
      Set desktop notification body
      +
      voidsetNotificationTitle(java.lang.String text) +
      Set desktop notification title
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DesktopNotify

        +
        public DesktopNotify(SwingTrayIcon sti,
        +                     java.lang.String iconpath)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isSupported

        +
        public boolean isSupported()
        +
        Is notifications supported
        +
        +
        Returns:
        +
        true if supported
        +
        +
      • +
      + + + +
        +
      • +

        isEnabled

        +
        public boolean isEnabled()
        +
        Are notifications enabled
        +
        +
        Returns:
        +
        true if enabled
        +
        +
      • +
      + + + +
        +
      • +

        setEnabled

        +
        public void setEnabled(boolean enabled)
        +
        Disable/Enable notifications
        +
        +
        Parameters:
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        setNotificationTitle

        +
        public void setNotificationTitle(java.lang.String text)
        +
        Set desktop notification title
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        setNotificationBody

        +
        public void setNotificationBody(java.lang.String text)
        +
        Set desktop notification body
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        raiseNotification

        +
        public void raiseNotification()
        +
        Raise a notification
        +
      • +
      + + + +
        +
      • +

        getNotifySendPath

        +
        public java.lang.String getNotifySendPath()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/ExtensionFileFilter.html b/javadoc/lib/ExtensionFileFilter.html new file mode 100644 index 0000000..f59e789 --- /dev/null +++ b/javadoc/lib/ExtensionFileFilter.html @@ -0,0 +1,340 @@ + + + + + + +ExtensionFileFilter (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class ExtensionFileFilter

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • javax.swing.filechooser.FileFilter
    • +
    • +
        +
      • lib.ExtensionFileFilter
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class ExtensionFileFilter
    +extends javax.swing.filechooser.FileFilter
    +
    +
    Author:
    +
    Alistair Neil, + Taken from Oracle documentation.
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      ExtensionFileFilter(java.lang.String description, + java.lang.String extension) +
      Convenience constructor for a single extension
      +
      ExtensionFileFilter(java.lang.String description, + java.lang.String[] extensions) +
      Convenience constructor for a multiple extensions
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleanaccept(java.io.File file) 
      java.lang.StringgetDescription() +
      Get description
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ExtensionFileFilter

        +
        public ExtensionFileFilter(java.lang.String description,
        +                           java.lang.String extension)
        +
        Convenience constructor for a single extension
        +
        +
        Parameters:
        +
        description -
        +
        extension -
        +
        +
      • +
      + + + +
        +
      • +

        ExtensionFileFilter

        +
        public ExtensionFileFilter(java.lang.String description,
        +                           java.lang.String[] extensions)
        +
        Convenience constructor for a multiple extensions
        +
        +
        Parameters:
        +
        description -
        +
        extensions -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getDescription

        +
        public java.lang.String getDescription()
        +
        Get description
        +
        +
        Specified by:
        +
        getDescription in class javax.swing.filechooser.FileFilter
        +
        Returns:
        +
        String
        +
        +
      • +
      + + + +
        +
      • +

        accept

        +
        public boolean accept(java.io.File file)
        +
        +
        Specified by:
        +
        accept in class javax.swing.filechooser.FileFilter
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/GTKFixes.html b/javadoc/lib/GTKFixes.html new file mode 100644 index 0000000..f1c470b --- /dev/null +++ b/javadoc/lib/GTKFixes.html @@ -0,0 +1,366 @@ + + + + + + +GTKFixes (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class GTKFixes

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.GTKFixes
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class GTKFixes
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      GTKFixes() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidfixJMenuPopupBorder(javax.swing.JMenu... jms) +
      Fixes incorrect JMenu border outline
      +
      static voidfixMenubarHeight(javax.swing.JMenuBar jmb, + javax.swing.JMenuItem jmi) 
      static voidfixMenuItemFgColor(javax.swing.JMenuItem... jmi) +
      Fixes incorrect JMenu selectionForeground highlighting
      +
      static voidfixMenuSelectionColor(javax.swing.JMenu... jms) +
      Fixes incorrect JMenu selectionForeground and selectionBackground + highlighting
      +
      static voidfixTextAreaColor(javax.swing.JTextArea jta) 
      static voidfixTrayMenuPopupBorder(TrayPopupMenu tpm) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GTKFixes

        +
        public GTKFixes()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        fixMenubarHeight

        +
        public static void fixMenubarHeight(javax.swing.JMenuBar jmb,
        +                                    javax.swing.JMenuItem jmi)
        +
      • +
      + + + +
        +
      • +

        fixMenuSelectionColor

        +
        public static void fixMenuSelectionColor(javax.swing.JMenu... jms)
        +
        Fixes incorrect JMenu selectionForeground and selectionBackground + highlighting
        +
        +
        Parameters:
        +
        jms - Array of JMenus or single JMenu
        +
        +
      • +
      + + + +
        +
      • +

        fixJMenuPopupBorder

        +
        public static void fixJMenuPopupBorder(javax.swing.JMenu... jms)
        +
        Fixes incorrect JMenu border outline
        +
        +
        Parameters:
        +
        jms - Array of JMenus or single JMenu
        +
        +
      • +
      + + + +
        +
      • +

        fixTrayMenuPopupBorder

        +
        public static void fixTrayMenuPopupBorder(TrayPopupMenu tpm)
        +
      • +
      + + + +
        +
      • +

        fixMenuItemFgColor

        +
        public static void fixMenuItemFgColor(javax.swing.JMenuItem... jmi)
        +
        Fixes incorrect JMenu selectionForeground highlighting
        +
        +
        Parameters:
        +
        jmi - Array of JMenuItems or single JMenuItem
        +
        +
      • +
      + + + +
        +
      • +

        fixTextAreaColor

        +
        public static void fixTextAreaColor(javax.swing.JTextArea jta)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/InfoDialog.html b/javadoc/lib/InfoDialog.html new file mode 100644 index 0000000..b5cecb1 --- /dev/null +++ b/javadoc/lib/InfoDialog.html @@ -0,0 +1,1072 @@ + + + + + + +InfoDialog (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class InfoDialog

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • java.awt.Window
        • +
        • +
            +
          • java.awt.Dialog
          • +
          • +
              +
            • javax.swing.JDialog
            • +
            • +
                +
              • lib.InfoDialog
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    +
    +
    +
    +
    public class InfoDialog
    +extends javax.swing.JDialog
    +
    +
    Author:
    +
    Alistair Neil,
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JDialog

        +javax.swing.JDialog.AccessibleJDialog
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Dialog

        +java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Window

        +java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeField and Description
      static intCANCEL_BUTTON 
      static intCANCEL_WINDOW 
      static intOK 
      +
        +
      • + + +

        Fields inherited from class javax.swing.JDialog

        +accessibleContext, rootPane, rootPaneCheckingEnabled
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Dialog

        +DEFAULT_MODALITY_TYPE
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface javax.swing.WindowConstants

        +DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      InfoDialog(java.awt.Frame parent) +
      Creates new InfoDialog, for parent frame with modality modal
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidappendInfoText(java.lang.String text) +
      Append text to the information area, Scrolling should be enabled
      +
      voidcreateError(java.lang.String title) +
      Create error dialog
      +
      voidcreateError(java.lang.String title, + java.lang.String info) +
      Create error dialog
      +
      voidcreateInfo(java.lang.String title) +
      Convenience methods
      +
      voidcreateInfo(java.lang.String title, + java.lang.String info) 
      voidcreateProgress(java.lang.String title, + java.lang.String info) +
      Create progress bar dialog
      +
      voidcreateWarn(java.lang.String title) 
      voidcreateWarn(java.lang.String title, + java.lang.String info) +
      Create warning dialog
      +
      java.awt.FontgetFont() 
      intgetReturnStatus() 
      javax.swing.JTextAreagetTextArea() 
      booleanisCheckBoxSelected() +
      Test to see if checkbox is selected
      +
      voidprogressTask(int status, + javax.swing.JProgressBar jpb) +
      Overridable handle for a progress based task
      +
      voidsetAckEnabled(boolean enabled) +
      Set whether Ok button is enabled
      +
      voidsetAckVisible(boolean visible) +
      Set whether OK button is visible
      +
      voidsetAutoClose(int millis) +
      Set the form auto close period in milliseconds
      +
      voidsetAutoScrollEnabled(boolean enabled) +
      Enable/Disable Autoscrolling
      +
      voidsetCancelButtonText(java.lang.String text) 
      voidsetCancelEnabled(boolean enabled) +
      Set whether Cancel button is enabled
      +
      voidsetCancelVisible(boolean visible) +
      Set whether Cancel button is visible
      +
      voidsetCheckBoxEnabled(boolean checked) +
      Set check box selection status
      +
      voidsetCheckBoxText(java.lang.String text) 
      voidsetCheckBoxVisible(boolean enabled) +
      Set whether the forms checkbox is enabled
      +
      voidsetCloseButtonText(java.lang.String text) 
      voidsetContinueButtonText(java.lang.String text) 
      voidsetFont(java.lang.String font, + int sizeoffset) +
      Set info font
      +
      voidsetInfoText(java.lang.String text) +
      Set dialog message body
      +
      voidsetInfoText(java.lang.String text, + java.awt.Color fgcolor) +
      Set dialog message body, and font colour
      +
      voidsetTimeLock(int secs) 
      voidsetTitle(java.lang.String title) +
      Set dialog title
      +
      voidsetVisibleWithFocus(boolean visible) 
      +
        +
      • + + +

        Methods inherited from class javax.swing.JDialog

        +addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Dialog

        +addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setUndecorated, setVisible, show, toBack
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Window

        +addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        InfoDialog

        +
        public InfoDialog(java.awt.Frame parent)
        +
        Creates new InfoDialog, for parent frame with modality modal
        +
        +
        Parameters:
        +
        parent -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getFont

        +
        public final java.awt.Font getFont()
        +
        +
        Specified by:
        +
        getFont in interface java.awt.MenuContainer
        +
        Overrides:
        +
        getFont in class java.awt.Component
        +
        +
      • +
      + + + +
        +
      • +

        createInfo

        +
        public final void createInfo(java.lang.String title)
        +
        Convenience methods
        +
        +
        Parameters:
        +
        title -
        +
        +
      • +
      + + + +
        +
      • +

        createInfo

        +
        public final void createInfo(java.lang.String title,
        +                             java.lang.String info)
        +
        +
        Parameters:
        +
        title -
        +
        info -
        +
        +
      • +
      + + + +
        +
      • +

        setTitle

        +
        public final void setTitle(java.lang.String title)
        +
        Set dialog title
        +
        +
        Overrides:
        +
        setTitle in class java.awt.Dialog
        +
        Parameters:
        +
        title -
        +
        +
      • +
      + + + +
        +
      • +

        createWarn

        +
        public final void createWarn(java.lang.String title)
        +
        +
        Parameters:
        +
        title -
        +
        +
      • +
      + + + +
        +
      • +

        createWarn

        +
        public final void createWarn(java.lang.String title,
        +                             java.lang.String info)
        +
        Create warning dialog
        +
        +
        Parameters:
        +
        title -
        +
        info -
        +
        +
      • +
      + + + +
        +
      • +

        createProgress

        +
        public final void createProgress(java.lang.String title,
        +                                 java.lang.String info)
        +
        Create progress bar dialog
        +
        +
        Parameters:
        +
        title -
        +
        info -
        +
        +
      • +
      + + + +
        +
      • +

        progressTask

        +
        public void progressTask(int status,
        +                         javax.swing.JProgressBar jpb)
        +
        Overridable handle for a progress based task
        +
        +
        Parameters:
        +
        status -
        +
        jpb -
        +
        +
      • +
      + + + +
        +
      • +

        createError

        +
        public final void createError(java.lang.String title)
        +
        Create error dialog
        +
        +
        Parameters:
        +
        title -
        +
        +
      • +
      + + + +
        +
      • +

        createError

        +
        public final void createError(java.lang.String title,
        +                              java.lang.String info)
        +
        Create error dialog
        +
        +
        Parameters:
        +
        title -
        +
        info -
        +
        +
      • +
      + + + +
        +
      • +

        setTimeLock

        +
        public final void setTimeLock(int secs)
        +
      • +
      + + + +
        +
      • +

        setCloseButtonText

        +
        public final void setCloseButtonText(java.lang.String text)
        +
      • +
      + + + +
        +
      • +

        setCancelButtonText

        +
        public final void setCancelButtonText(java.lang.String text)
        +
      • +
      + + + +
        +
      • +

        setContinueButtonText

        +
        public final void setContinueButtonText(java.lang.String text)
        +
      • +
      + + + +
        +
      • +

        setCheckBoxText

        +
        public final void setCheckBoxText(java.lang.String text)
        +
      • +
      + + + +
        +
      • +

        setAutoScrollEnabled

        +
        public final void setAutoScrollEnabled(boolean enabled)
        +
        Enable/Disable Autoscrolling
        +
        +
        Parameters:
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        appendInfoText

        +
        public final void appendInfoText(java.lang.String text)
        +
        Append text to the information area, Scrolling should be enabled
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        setCheckBoxVisible

        +
        public final void setCheckBoxVisible(boolean enabled)
        +
        Set whether the forms checkbox is enabled
        +
        +
        Parameters:
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        setCheckBoxEnabled

        +
        public final void setCheckBoxEnabled(boolean checked)
        +
        Set check box selection status
        +
        +
        Parameters:
        +
        checked -
        +
        +
      • +
      + + + +
        +
      • +

        isCheckBoxSelected

        +
        public final boolean isCheckBoxSelected()
        +
        Test to see if checkbox is selected
        +
        +
        Returns:
        +
        boolean True if selected
        +
        +
      • +
      + + + +
        +
      • +

        setFont

        +
        public final void setFont(java.lang.String font,
        +                          int sizeoffset)
        +
        Set info font
        +
        +
        Parameters:
        +
        font -
        +
        sizeoffset -
        +
        +
      • +
      + + + +
        +
      • +

        setAutoClose

        +
        public final void setAutoClose(int millis)
        +
        Set the form auto close period in milliseconds
        +
        +
        Parameters:
        +
        millis -
        +
        +
      • +
      + + + +
        +
      • +

        getTextArea

        +
        public final javax.swing.JTextArea getTextArea()
        +
      • +
      + + + +
        +
      • +

        getReturnStatus

        +
        public final int getReturnStatus()
        +
        +
        Returns:
        +
        the return status of this dialog - one of RET_OK or RET_CANCEL
        +
        +
      • +
      + + + +
        +
      • +

        setInfoText

        +
        public final void setInfoText(java.lang.String text)
        +
        Set dialog message body
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        setInfoText

        +
        public final void setInfoText(java.lang.String text,
        +                              java.awt.Color fgcolor)
        +
        Set dialog message body, and font colour
        +
        +
        Parameters:
        +
        text -
        +
        fgcolor -
        +
        +
      • +
      + + + +
        +
      • +

        setCancelEnabled

        +
        public final void setCancelEnabled(boolean enabled)
        +
        Set whether Cancel button is enabled
        +
        +
        Parameters:
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        setCancelVisible

        +
        public final void setCancelVisible(boolean visible)
        +
        Set whether Cancel button is visible
        +
        +
        Parameters:
        +
        visible -
        +
        +
      • +
      + + + +
        +
      • +

        setAckEnabled

        +
        public final void setAckEnabled(boolean enabled)
        +
        Set whether Ok button is enabled
        +
        +
        Parameters:
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        setAckVisible

        +
        public final void setAckVisible(boolean visible)
        +
        Set whether OK button is visible
        +
        +
        Parameters:
        +
        visible -
        +
        +
      • +
      + + + +
        +
      • +

        setVisibleWithFocus

        +
        public void setVisibleWithFocus(boolean visible)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/Localisation.html b/javadoc/lib/Localisation.html new file mode 100644 index 0000000..4960cb1 --- /dev/null +++ b/javadoc/lib/Localisation.html @@ -0,0 +1,362 @@ + + + + + + +Localisation (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class Localisation

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.Localisation
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class Localisation
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil,
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Localisation(java.lang.String resource) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringgetDisplayCountry(java.lang.String iso2) +
      Get the country name for supplied iso2 code
      +
      java.util.LocalegetLocale() +
      Get the locale
      +
      java.lang.StringgetString(java.lang.String key) +
      Get localised string using given key
      +
      java.lang.String[]getStrings(java.lang.String... keys) +
      Get an array of localised strings using a key array or multiple keys
      +
      java.lang.StringtoWebLanguageTag() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Localisation

        +
        public Localisation(java.lang.String resource)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getLocale

        +
        public java.util.Locale getLocale()
        +
        Get the locale
        +
        +
        Returns:
        +
        The locale
        +
        +
      • +
      + + + +
        +
      • +

        toWebLanguageTag

        +
        public java.lang.String toWebLanguageTag()
        +
      • +
      + + + +
        +
      • +

        getDisplayCountry

        +
        public java.lang.String getDisplayCountry(java.lang.String iso2)
        +
        Get the country name for supplied iso2 code
        +
        +
        Parameters:
        +
        iso2 -
        +
        Returns:
        +
        Localised country name
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public java.lang.String getString(java.lang.String key)
        +
        Get localised string using given key
        +
        +
        Parameters:
        +
        key -
        +
        Returns:
        +
        localised string
        +
        +
      • +
      + + + +
        +
      • +

        getStrings

        +
        public java.lang.String[] getStrings(java.lang.String... keys)
        +
        Get an array of localised strings using a key array or multiple keys
        +
        +
        Parameters:
        +
        keys -
        +
        Returns:
        +
        localised string array
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/NetFunctions.HttpPage.html b/javadoc/lib/NetFunctions.HttpPage.html new file mode 100644 index 0000000..1d64007 --- /dev/null +++ b/javadoc/lib/NetFunctions.HttpPage.html @@ -0,0 +1,480 @@ + + + + + + +NetFunctions.HttpPage (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class NetFunctions.HttpPage

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.NetFunctions.HttpPage
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    NetFunctions
    +
    +
    +
    +
    public static final class NetFunctions.HttpPage
    +extends java.lang.Object
    +
    Store an http formatted web page
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      HttpPage(java.io.InputStream is) +
      Store webpage from the given input stream
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringgetBodyAsString() +
      Retrieve http body as string should only be used with text content
      +
      longgetExpires() 
      longgetLastModified() 
      java.lang.StringgetProperty(java.lang.String key) +
      Get various properties of the web page
      +
      longgetServerDate() 
      booleanisHeaderOK() 
      voidretrieveHeader() +
      Retrieve http header info
      +
      booleansaveBodyToFile(java.lang.String dest, + javax.swing.JProgressBar jpb) +
      Save http body to a file, applies to all types of content
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        PATTERN_RFC1123

        +
        public static final java.lang.String PATTERN_RFC1123
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        PATTERN_RFC1036

        +
        public static final java.lang.String PATTERN_RFC1036
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      + + + +
        +
      • +

        PATTERN_ASCTIME

        +
        public static final java.lang.String PATTERN_ASCTIME
        +
        +
        See Also:
        +
        Constant Field Values
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HttpPage

        +
        public HttpPage(java.io.InputStream is)
        +
        Store webpage from the given input stream
        +
        +
        Parameters:
        +
        is -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        retrieveHeader

        +
        public final void retrieveHeader()
        +
        Retrieve http header info
        +
      • +
      + + + +
        +
      • +

        getBodyAsString

        +
        public final java.lang.String getBodyAsString()
        +
        Retrieve http body as string should only be used with text content
        +
        +
        Returns:
        +
        null if failed, otherwise returns the contents
        +
        +
      • +
      + + + +
        +
      • +

        saveBodyToFile

        +
        public final boolean saveBodyToFile(java.lang.String dest,
        +                                    javax.swing.JProgressBar jpb)
        +
        Save http body to a file, applies to all types of content
        +
        +
        Parameters:
        +
        dest - File destination
        +
        jpb - Progress bar
        +
        Returns:
        +
        true if successful
        +
        +
      • +
      + + + +
        +
      • +

        getProperty

        +
        public final java.lang.String getProperty(java.lang.String key)
        +
        Get various properties of the web page
        +
        +
        Parameters:
        +
        key -
        +
        Returns:
        +
        property string
        +
        +
      • +
      + + + +
        +
      • +

        getLastModified

        +
        public final long getLastModified()
        +
      • +
      + + + +
        +
      • +

        getServerDate

        +
        public final long getServerDate()
        +
      • +
      + + + +
        +
      • +

        getExpires

        +
        public final long getExpires()
        +
      • +
      + + + +
        +
      • +

        isHeaderOK

        +
        public final boolean isHeaderOK()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/NetFunctions.html b/javadoc/lib/NetFunctions.html new file mode 100644 index 0000000..2f08c0a --- /dev/null +++ b/javadoc/lib/NetFunctions.html @@ -0,0 +1,624 @@ + + + + + + +NetFunctions (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class NetFunctions

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.NetFunctions
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class NetFunctions
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil,
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClass and Description
      static class NetFunctions.HttpPage +
      Store an http formatted web page
      +
      +
    • +
    + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      NetFunctions() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      longgetLatency(java.lang.String surl, + java.net.Proxy proxy, + int timeout) +
      Get latency non threaded version
      +
      java.lang.StringgetURLContentAsString(java.lang.String sourceurl, + java.net.Socket s) +
      Check web for updates and return version string if an update is available
      +
      booleanisIPAddress(java.lang.String ipaddress) +
      Make sure ipaddress is valid number
      +
      java.io.InputStreamopenStreamToURL(java.lang.String surl, + java.net.Socket s) +
      Open an inputstream to the given url on the given socket
      +
      intsaveURLContentToFile(java.lang.String destfile, + java.lang.String sourceurl, + java.net.Socket socket, + boolean force) +
      Save the contents of a URL to a file
      +
      voidsetProgressBar(javax.swing.JProgressBar jpb) 
      voidsetSocketTimeout(int timeout) +
      Set default socket timeout
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        NetFunctions

        +
        public NetFunctions()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setSocketTimeout

        +
        public void setSocketTimeout(int timeout)
        +
        Set default socket timeout
        +
        +
        Parameters:
        +
        timeout -
        +
        +
      • +
      + + + +
        +
      • +

        setProgressBar

        +
        public void setProgressBar(javax.swing.JProgressBar jpb)
        +
      • +
      + + + +
        +
      • +

        saveURLContentToFile

        +
        public int saveURLContentToFile(java.lang.String destfile,
        +                                java.lang.String sourceurl,
        +                                java.net.Socket socket,
        +                                boolean force)
        +
        Save the contents of a URL to a file
        +
        +
        Parameters:
        +
        destfile - File destination path
        +
        sourceurl - URL
        +
        socket -
        +
        force - Forces update regardless of age
        +
        Returns:
        +
        int File retieval status code
        +
        +
      • +
      + + + +
        +
      • +

        isIPAddress

        +
        public boolean isIPAddress(java.lang.String ipaddress)
        +
        Make sure ipaddress is valid number
        +
        +
        Parameters:
        +
        ipaddress -
        +
        Returns:
        +
        true if a valid ip address
        +
        +
      • +
      + + + +
        +
      • +

        getLatency

        +
        public long getLatency(java.lang.String surl,
        +                       java.net.Proxy proxy,
        +                       int timeout)
        +
        Get latency non threaded version
        +
        +
        Parameters:
        +
        surl - Testing url
        +
        proxy - Specify a proxy, null == no proxy
        +
        timeout - Specify a timeout before declaring failure
        +
        Returns:
        +
        long latency in milliseconds
        +
        +
      • +
      + + + +
        +
      • +

        getURLContentAsString

        +
        public java.lang.String getURLContentAsString(java.lang.String sourceurl,
        +                                              java.net.Socket s)
        +
        Check web for updates and return version string if an update is available
        +
        +
        Parameters:
        +
        sourceurl - URL to check
        +
        s - Socket
        +
        Returns:
        +
        String new version number
        +
        +
      • +
      + + + +
        +
      • +

        openStreamToURL

        +
        public java.io.InputStream openStreamToURL(java.lang.String surl,
        +                                           java.net.Socket s)
        +
        Open an inputstream to the given url on the given socket
        +
        +
        Parameters:
        +
        surl -
        +
        s -
        +
        Returns:
        +
        inputstream
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/OSFunction.html b/javadoc/lib/OSFunction.html new file mode 100644 index 0000000..2d4a4b1 --- /dev/null +++ b/javadoc/lib/OSFunction.html @@ -0,0 +1,1230 @@ + + + + + + +OSFunction (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class OSFunction

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.OSFunction
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class OSFunction
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      OSFunction() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidclearActiveProcesses() +
      Clear active processes, mainly to reduce memory consumption when were + done with them
      +
      static java.util.ArrayList<java.lang.String>filterProcesses(java.util.ArrayList<java.lang.String> processes, + java.lang.String filter) +
      Find processes matching the contents of filter
      +
      static java.util.ArrayList<java.lang.String>filterProcesses(java.lang.String filter) +
      Find processes matching the contents of filter
      +
      static java.lang.StringfindFile(java.lang.String fname, + java.lang.String... paths) +
      Find a specific file, requires a series of paths where it might be found + to be provided
      +
      static java.lang.StringgetActiveDesktop() +
      Get the name of the active desktop
      +
      static java.lang.StringgetAppSettingsPath(java.lang.String appname, + java.lang.String appseries) +
      Get a specified application's settings folder, if null return this + applications setting folder
      +
      static java.util.ArrayList<java.lang.String>getCachedProcesses() +
      Cached list of processes
      +
      static java.lang.StringgetCompositor() +
      Get the name of the compositor
      +
      static java.lang.StringgetFileSeparator() +
      Get file separator
      +
      static java.lang.StringgetGnome3Pref(java.lang.String schema, + java.lang.String key) +
      Get gnome 3 preference using schema name and key name
      +
      static java.lang.StringgetGsettingsPath() +
      Test if gsettings installed (Linux only)
      +
      static java.lang.StringgetKDEPref(java.lang.String group, + java.lang.String key, + java.lang.String def) +
      Get a kde preference string value using group name, key name and return + contents of def on failure
      +
      static java.lang.StringgetKDEProxyPath() +
      Test for KDE installed (Linux only)
      +
      static java.lang.StringgetLangCode() +
      Get default language iso code
      +
      static java.util.ArrayList<java.lang.String>getLiveProcesses() +
      Gets list of active system processes
      +
      static java.lang.StringgetOSArch() +
      Get OS architecture, convenience method
      +
      static java.lang.StringgetOSName() +
      Get OS name, convenience method
      +
      static java.lang.StringgetOSVersion() +
      Get OS version
      +
      static java.lang.StringgetOurProcessID() +
      Get process id
      +
      static java.lang.StringgetProcessID(java.lang.String process) +
      Get process id from a process
      +
      static java.util.ArrayList<java.lang.String>getProcessOutput(java.io.InputStream is) +
      Obtain all output of an executed process.
      +
      static java.lang.StringgetProcessResult(java.lang.Process aprocess) +
      Convenience method to get the first resultant output of an executed + process as a String
      +
      static java.lang.StringgetTempFolder(java.lang.String path) +
      Get users temp folder
      +
      static java.lang.StringgetUserName() +
      Get user name
      +
      static java.lang.StringgetUsersCurrentFolder() +
      Get users current folder
      +
      static java.lang.StringgetUsersDocFolder() +
      Get users documents folder (Windows only)
      +
      static java.lang.StringgetUserSettingsPath() +
      Get user settings path
      +
      static java.lang.StringgetUsersHomeFolder() +
      Get users home folder
      +
      static booleanisLinux() +
      Generic test for Linux platform
      +
      static booleanisMultipleInstance(java.lang.String appname) +
      Test to see if their are multiple instances of the this app running
      +
      static booleanisWin10() +
      Specific test for Win 10
      +
      static booleanisWin7() +
      Specific test for Win 7
      +
      static booleanisWin8() +
      Specific test for Win 8
      +
      static booleanisWindows() +
      Generic test for Windows platform
      +
      static booleanisWinXP() +
      Specific test for Win XP
      +
      static java.lang.StringkillProcess(java.lang.String pid) +
      Generic kill process with matching pid
      +
      static java.lang.ProcesslaunchProcess(java.lang.String... command) +
      Launch an external process with arguments
      +
      static voidresetGnome3Pref(java.lang.String schema, + java.lang.String key) +
      Reset a gnome3 value to its default.
      +
      static voidsetFileHidden(java.lang.String filepath, + boolean hidden) +
      Set a files hidden status (Windows only)
      +
      static voidsetGnome3Pref(java.lang.String schema, + java.lang.String key, + boolean value) +
      Set a gnome 3 boolean value using schema name and key name
      +
      static voidsetGnome3Pref(java.lang.String schema, + java.lang.String key, + java.lang.String value) +
      Set a gnome 3 string value using schema name and key name
      +
      static voidsetKDEPref(java.lang.String group, + java.lang.String key, + boolean value) +
      Set a kde boolean preference value using group name, key name
      +
      static voidsetKDEPref(java.lang.String group, + java.lang.String key, + int value) +
      Set a kde integer preference value using group name, key name
      +
      static voidsetKDEPref(java.lang.String group, + java.lang.String key, + java.lang.String value) +
      Set a kde string preference value using group name, key name
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        OSFunction

        +
        public OSFunction()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getOurProcessID

        +
        public static java.lang.String getOurProcessID()
        +
        Get process id
        +
        +
        Returns:
        +
        Process id or -1 if not found
        +
        +
      • +
      + + + +
        +
      • +

        getProcessID

        +
        public static java.lang.String getProcessID(java.lang.String process)
        +
        Get process id from a process
        +
        +
        Parameters:
        +
        process -
        +
        Returns:
        +
        process id as String
        +
        +
      • +
      + + + +
        +
      • +

        getOSVersion

        +
        public static java.lang.String getOSVersion()
        +
        Get OS version
        +
        +
        Returns:
        +
        String OS version
        +
        +
      • +
      + + + +
        +
      • +

        getUserName

        +
        public static java.lang.String getUserName()
        +
        Get user name
        +
        +
        Returns:
        +
        String User name
        +
        +
      • +
      + + + +
        +
      • +

        getUsersHomeFolder

        +
        public static java.lang.String getUsersHomeFolder()
        +
        Get users home folder
        +
        +
        Returns:
        +
        String path to home folder
        +
        +
      • +
      + + + +
        +
      • +

        getFileSeparator

        +
        public static java.lang.String getFileSeparator()
        +
        Get file separator
        +
        +
        Returns:
        +
        String separator
        +
        +
      • +
      + + + +
        +
      • +

        getUsersDocFolder

        +
        public static java.lang.String getUsersDocFolder()
        +
        Get users documents folder (Windows only)
        +
        +
        Returns:
        +
        String path to documents folder
        +
        +
      • +
      + + + +
        +
      • +

        getUserSettingsPath

        +
        public static java.lang.String getUserSettingsPath()
        +
        Get user settings path
        +
        +
        Returns:
        +
        String path to user settings folder
        +
        +
      • +
      + + + +
        +
      • +

        getAppSettingsPath

        +
        public static java.lang.String getAppSettingsPath(java.lang.String appname,
        +                                                  java.lang.String appseries)
        +
        Get a specified application's settings folder, if null return this + applications setting folder
        +
        +
        Parameters:
        +
        appname - Application settings folder name
        +
        appseries - Application series (optional)
        +
        Returns:
        +
        String Path to the applications setting folder
        +
        +
      • +
      + + + +
        +
      • +

        getUsersCurrentFolder

        +
        public static java.lang.String getUsersCurrentFolder()
        +
        Get users current folder
        +
        +
        Returns:
        +
        String Path to current folder
        +
        +
      • +
      + + + +
        +
      • +

        getTempFolder

        +
        public static java.lang.String getTempFolder(java.lang.String path)
        +
        Get users temp folder
        +
        +
        Parameters:
        +
        path -
        +
        Returns:
        +
        String Path to users temp folder
        +
        +
      • +
      + + + +
        +
      • +

        getOSName

        +
        public static java.lang.String getOSName()
        +
        Get OS name, convenience method
        +
        +
        Returns:
        +
        String
        +
        +
      • +
      + + + +
        +
      • +

        getOSArch

        +
        public static java.lang.String getOSArch()
        +
        Get OS architecture, convenience method
        +
        +
        Returns:
        +
        String
        +
        +
      • +
      + + + +
        +
      • +

        isWindows

        +
        public static boolean isWindows()
        +
        Generic test for Windows platform
        +
        +
        Returns:
        +
        boolean True if Windows
        +
        +
      • +
      + + + +
        +
      • +

        isWin7

        +
        public static boolean isWin7()
        +
        Specific test for Win 7
        +
        +
        Returns:
        +
        boolean True if Win 7
        +
        +
      • +
      + + + +
        +
      • +

        isWin8

        +
        public static boolean isWin8()
        +
        Specific test for Win 8
        +
        +
        Returns:
        +
        boolean True if Win 8
        +
        +
      • +
      + + + +
        +
      • +

        isWin10

        +
        public static boolean isWin10()
        +
        Specific test for Win 10
        +
        +
        Returns:
        +
        boolean True if Win 10
        +
        +
      • +
      + + + +
        +
      • +

        isWinXP

        +
        public static boolean isWinXP()
        +
        Specific test for Win XP
        +
        +
        Returns:
        +
        boolean True if Win XP
        +
        +
      • +
      + + + +
        +
      • +

        isLinux

        +
        public static boolean isLinux()
        +
        Generic test for Linux platform
        +
        +
        Returns:
        +
        boolean True if Linux
        +
        +
      • +
      + + + +
        +
      • +

        findFile

        +
        public static java.lang.String findFile(java.lang.String fname,
        +                                        java.lang.String... paths)
        +
        Find a specific file, requires a series of paths where it might be found + to be provided
        +
        +
        Parameters:
        +
        fname -
        +
        paths -
        +
        Returns:
        +
        String path to file or null
        +
        +
      • +
      + + + +
        +
      • +

        isMultipleInstance

        +
        public static boolean isMultipleInstance(java.lang.String appname)
        +
        Test to see if their are multiple instances of the this app running
        +
        +
        Parameters:
        +
        appname -
        +
        Returns:
        +
        True if multiple instance
        +
        +
      • +
      + + + +
        +
      • +

        getCachedProcesses

        +
        public static java.util.ArrayList<java.lang.String> getCachedProcesses()
        +
        Cached list of processes
        +
        +
        Returns:
        +
        list
        +
        +
      • +
      + + + +
        +
      • +

        filterProcesses

        +
        public static java.util.ArrayList<java.lang.String> filterProcesses(java.util.ArrayList<java.lang.String> processes,
        +                                                                    java.lang.String filter)
        +
        Find processes matching the contents of filter
        +
        +
        Parameters:
        +
        processes -
        +
        filter -
        +
        Returns:
        +
        ArrayList of matching processes
        +
        +
      • +
      + + + +
        +
      • +

        filterProcesses

        +
        public static java.util.ArrayList<java.lang.String> filterProcesses(java.lang.String filter)
        +
        Find processes matching the contents of filter
        +
        +
        Parameters:
        +
        filter -
        +
        Returns:
        +
        ArrayList of matching processes
        +
        +
      • +
      + + + +
        +
      • +

        killProcess

        +
        public static java.lang.String killProcess(java.lang.String pid)
        +
        Generic kill process with matching pid
        +
        +
        Parameters:
        +
        pid -
        +
        Returns:
        +
        String kill result or null if failed
        +
        +
      • +
      + + + +
        +
      • +

        setFileHidden

        +
        public static void setFileHidden(java.lang.String filepath,
        +                                 boolean hidden)
        +
        Set a files hidden status (Windows only)
        +
        +
        Parameters:
        +
        filepath - Path to file includes filename
        +
        hidden - True/False
        +
        +
      • +
      + + + +
        +
      • +

        getGnome3Pref

        +
        public static java.lang.String getGnome3Pref(java.lang.String schema,
        +                                             java.lang.String key)
        +
        Get gnome 3 preference using schema name and key name
        +
        +
        Parameters:
        +
        schema -
        +
        key -
        +
        Returns:
        +
        String preference value
        +
        +
      • +
      + + + +
        +
      • +

        setGnome3Pref

        +
        public static void setGnome3Pref(java.lang.String schema,
        +                                 java.lang.String key,
        +                                 boolean value)
        +
        Set a gnome 3 boolean value using schema name and key name
        +
        +
        Parameters:
        +
        schema -
        +
        key -
        +
        value -
        +
        +
      • +
      + + + +
        +
      • +

        setGnome3Pref

        +
        public static void setGnome3Pref(java.lang.String schema,
        +                                 java.lang.String key,
        +                                 java.lang.String value)
        +
        Set a gnome 3 string value using schema name and key name
        +
        +
        Parameters:
        +
        schema -
        +
        key -
        +
        value -
        +
        +
      • +
      + + + +
        +
      • +

        resetGnome3Pref

        +
        public static void resetGnome3Pref(java.lang.String schema,
        +                                   java.lang.String key)
        +
        Reset a gnome3 value to its default. If key is null, it will reset the + whole schema tree to its defaults
        +
        +
        Parameters:
        +
        schema -
        +
        key -
        +
        +
      • +
      + + + +
        +
      • +

        getKDEPref

        +
        public static java.lang.String getKDEPref(java.lang.String group,
        +                                          java.lang.String key,
        +                                          java.lang.String def)
        +
        Get a kde preference string value using group name, key name and return + contents of def on failure
        +
        +
        Parameters:
        +
        group -
        +
        key -
        +
        def -
        +
        Returns:
        +
        String Preference value
        +
        +
      • +
      + + + +
        +
      • +

        setKDEPref

        +
        public static void setKDEPref(java.lang.String group,
        +                              java.lang.String key,
        +                              java.lang.String value)
        +
        Set a kde string preference value using group name, key name
        +
        +
        Parameters:
        +
        group -
        +
        key -
        +
        value -
        +
        +
      • +
      + + + +
        +
      • +

        setKDEPref

        +
        public static void setKDEPref(java.lang.String group,
        +                              java.lang.String key,
        +                              boolean value)
        +
        Set a kde boolean preference value using group name, key name
        +
        +
        Parameters:
        +
        group -
        +
        key -
        +
        value -
        +
        +
      • +
      + + + +
        +
      • +

        setKDEPref

        +
        public static void setKDEPref(java.lang.String group,
        +                              java.lang.String key,
        +                              int value)
        +
        Set a kde integer preference value using group name, key name
        +
        +
        Parameters:
        +
        group -
        +
        key -
        +
        value -
        +
        +
      • +
      + + + +
        +
      • +

        getKDEProxyPath

        +
        public static java.lang.String getKDEProxyPath()
        +
        Test for KDE installed (Linux only)
        +
        +
        Returns:
        +
        String path to kde proxy file or null
        +
        +
      • +
      + + + +
        +
      • +

        getGsettingsPath

        +
        public static java.lang.String getGsettingsPath()
        +
        Test if gsettings installed (Linux only)
        +
        +
        Returns:
        +
        String path to gsetttings
        +
        +
      • +
      + + + +
        +
      • +

        getProcessResult

        +
        public static java.lang.String getProcessResult(java.lang.Process aprocess)
        +
        Convenience method to get the first resultant output of an executed + process as a String
        +
        +
        Parameters:
        +
        aprocess -
        +
        Returns:
        +
        String Process result
        +
        +
      • +
      + + + +
        +
      • +

        getProcessOutput

        +
        public static java.util.ArrayList<java.lang.String> getProcessOutput(java.io.InputStream is)
        +
        Obtain all output of an executed process.
        +
        +
        Parameters:
        +
        is -
        +
        Returns:
        +
        ArrayList of Strings containing all generated output
        +
        +
      • +
      + + + +
        +
      • +

        launchProcess

        +
        public static java.lang.Process launchProcess(java.lang.String... command)
        +
        Launch an external process with arguments
        +
        +
        Parameters:
        +
        command -
        +
        Returns:
        +
        Process
        +
        +
      • +
      + + + +
        +
      • +

        getLiveProcesses

        +
        public static java.util.ArrayList<java.lang.String> getLiveProcesses()
        +
        Gets list of active system processes
        +
        +
        Returns:
        +
        Arraylist of system process
        +
        +
      • +
      + + + +
        +
      • +

        getCompositor

        +
        public static java.lang.String getCompositor()
        +
        Get the name of the compositor
        +
        +
        Returns:
        +
        name as String
        +
        +
      • +
      + + + +
        +
      • +

        getActiveDesktop

        +
        public static java.lang.String getActiveDesktop()
        +
        Get the name of the active desktop
        +
        +
        Returns:
        +
        name as String
        +
        +
      • +
      + + + +
        +
      • +

        clearActiveProcesses

        +
        public static void clearActiveProcesses()
        +
        Clear active processes, mainly to reduce memory consumption when were + done with them
        +
      • +
      + + + +
        +
      • +

        getLangCode

        +
        public static java.lang.String getLangCode()
        +
        Get default language iso code
        +
        +
        Returns:
        +
        language iso code
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/SimpleFile.html b/javadoc/lib/SimpleFile.html new file mode 100644 index 0000000..a861b38 --- /dev/null +++ b/javadoc/lib/SimpleFile.html @@ -0,0 +1,1424 @@ + + + + + + +SimpleFile (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class SimpleFile

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.SimpleFile
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public class SimpleFile
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil info@dazzleships.net
    +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + +
      Constructors 
      Constructor and Description
      SimpleFile() 
      SimpleFile(java.lang.String pathname) +
      Constructor
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleanaddFilesToZip(java.io.File... srcfiles) +
      Add files to a zip file
      +
      voidcloseFile() +
      Close file and any resources such as buffered readers/writers that are + attached to it.
      +
      voidcloseZipStream() +
      Close a zip stream
      +
      static voidcompress(java.lang.String source, + java.lang.String dest) 
      static voidcopyFolderContents(java.lang.String from, + java.lang.String to, + java.lang.String ignore) +
      Copy multiple files from one folder to another
      +
      static voidcopyFromTo(java.lang.String frompath, + java.lang.String topath) +
      Copy file to
      +
      booleancreateFile() +
      Create a new file
      +
      booleancreateFolder() +
      Creates a new folder
      +
      static booleancreateFolder(java.lang.String path) +
      Creates a new folder
      +
      booleandelete() +
      Deletes file
      +
      static booleandelete(java.lang.String filename) +
      Deletes the specified file
      +
      voiddeleteFileList(java.io.File[] files) +
      Deletes the supplied list of files, be very carefull with this
      +
      static booleandeleteFolder(java.lang.String folder) +
      Delete folder and its contents using specified folder path
      +
      booleanexists() +
      Test to see if path exists
      +
      static booleanexists(java.lang.String pathname) +
      Test to see if path exists
      +
      booleanextractZipTo(java.lang.String destpath) +
      Extracts a zip file to a supplied location
      +
      voidflushWriter() 
      static floatgetAgeOfFile(java.lang.String filepath, + int period) +
      Get the age of a specified file
      +
      java.io.FilegetFile() +
      Get file
      +
      java.lang.StringgetFileFilter() +
      Gets the current file filter
      +
      java.io.File[]getFileList() +
      Gets the file list at the specified directory location based on filter + contents
      +
      java.lang.String[]getFilenames(int offset) +
      Returns an array of filenames, array if populated from the offset value + onwards
      +
      java.io.FilegetOldestFile() 
      static java.lang.StringgetSeparator() 
      static booleanisDaysOlder(java.lang.String filename, + long days) +
      Test to see our file is older in days, returns true if it is
      +
      static booleanisHoursOlder(java.lang.String filename, + long hours) +
      Test to see our file is older in hours, returns true if it is
      +
      static booleanisMinutesOlder(java.lang.String filename, + long minutes) +
      Test to see our file is older in minutes, returns true if it is
      +
      static voidmergeFiles(java.lang.String srcpath1, + java.lang.String srcpath2, + java.lang.String destpath) 
      static java.lang.ObjectobjectRead(java.lang.String filepath, + java.lang.Object defObject) 
      static booleanobjectWrite(java.lang.String filepath, + java.lang.Object o) 
      voidopenBufferedAppend() +
      Opens a buffered file for append
      +
      java.io.BufferedReaderopenBufferedRead() +
      Opens a buffered file for read
      +
      voidopenBufferedResource() +
      Use this if you need access to a file within a jar
      +
      voidopenBufferedWrite() +
      Opens a buffered file for write
      +
      java.io.FileInputStreamopenFileInputStream(java.lang.String filename) 
      java.io.FileOutputStreamopenFileOutputStream() +
      Opens a file output stream
      +
      booleanopenZipStream(int level) +
      Opens a zipstream.
      +
      java.lang.StringreadEntireFile() +
      Read bytes from previously opened BufferedReader
      +
      java.lang.StringreadLine() +
      Read a single line from a text file
      +
      booleanrenameFile(java.lang.String toname) 
      static java.io.FilerenameTo(java.io.File f, + java.lang.String newname) 
      static voidsecureWipe(java.io.File f) +
      Wipe file using specified File
      +
      static voidsecureWipe(java.lang.String filename) +
      Wipe file using specified filename
      +
      static voidsecureWipeFolder(java.io.File folder) +
      Wipe folder and its contents using specified File
      +
      static voidsecureWipeFolder(java.lang.String folder) +
      Wipe folder and its contents using specified folder path
      +
      voidsetFile(java.io.File file) +
      Set file
      +
      voidsetFileFilter(java.lang.String filter) +
      Sets the file filter
      +
      voidsetFileName(java.lang.String pathname) +
      Set filename
      +
      static voidwalkFileTree(java.lang.String path, + java.util.ArrayList<java.io.File> files) 
      static voidwalkFileTree(java.lang.String path, + java.util.ArrayList<java.io.File> files, + java.lang.String filter) 
      voidwriteFile(char[] data, + int nochars) +
      Write to a previously opened output file
      +
      voidwriteFile(java.lang.String data, + int newlines) +
      Write to a previously opened output file
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SimpleFile

        +
        public SimpleFile()
        +
      • +
      + + + +
        +
      • +

        SimpleFile

        +
        public SimpleFile(java.lang.String pathname)
        +
        Constructor
        +
        +
        Parameters:
        +
        pathname -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setFileName

        +
        public final void setFileName(java.lang.String pathname)
        +
        Set filename
        +
        +
        Parameters:
        +
        pathname -
        +
        +
      • +
      + + + +
        +
      • +

        setFile

        +
        public final void setFile(java.io.File file)
        +
        Set file
        +
        +
        Parameters:
        +
        file -
        +
        +
      • +
      + + + +
        +
      • +

        getFile

        +
        public final java.io.File getFile()
        +
        Get file
        +
        +
        Returns:
        +
        file
        +
        +
      • +
      + + + +
        +
      • +

        closeFile

        +
        public final void closeFile()
        +
        Close file and any resources such as buffered readers/writers that are + attached to it.
        +
      • +
      + + + +
        +
      • +

        setFileFilter

        +
        public final void setFileFilter(java.lang.String filter)
        +
        Sets the file filter
        +
        +
        Parameters:
        +
        filter -
        +
        +
      • +
      + + + +
        +
      • +

        getFileFilter

        +
        public final java.lang.String getFileFilter()
        +
        Gets the current file filter
        +
        +
        Returns:
        +
        Returns the file filter
        +
        +
      • +
      + + + +
        +
      • +

        getSeparator

        +
        public static final java.lang.String getSeparator()
        +
      • +
      + + + +
        +
      • +

        createFolder

        +
        public final boolean createFolder()
        +
        Creates a new folder
        +
        +
        Returns:
        +
        True if successful
        +
        +
      • +
      + + + +
        +
      • +

        createFolder

        +
        public static final boolean createFolder(java.lang.String path)
        +
        Creates a new folder
        +
        +
        Parameters:
        +
        path - The location of the new folder
        +
        Returns:
        +
        True if successful
        +
        +
      • +
      + + + +
        +
      • +

        createFile

        +
        public final boolean createFile()
        +
        Create a new file
        +
        +
        Returns:
        +
        True if file exist or is created
        +
        +
      • +
      + + + +
        +
      • +

        getFileList

        +
        public final java.io.File[] getFileList()
        +
        Gets the file list at the specified directory location based on filter + contents
        +
        +
        Returns:
        +
        An array of Files
        +
        +
      • +
      + + + +
        +
      • +

        getOldestFile

        +
        public final java.io.File getOldestFile()
        +
      • +
      + + + +
        +
      • +

        walkFileTree

        +
        public static final void walkFileTree(java.lang.String path,
        +                                      java.util.ArrayList<java.io.File> files)
        +
      • +
      + + + +
        +
      • +

        walkFileTree

        +
        public static final void walkFileTree(java.lang.String path,
        +                                      java.util.ArrayList<java.io.File> files,
        +                                      java.lang.String filter)
        +
      • +
      + + + +
        +
      • +

        deleteFileList

        +
        public final void deleteFileList(java.io.File[] files)
        +
        Deletes the supplied list of files, be very carefull with this
        +
        +
        Parameters:
        +
        files -
        +
        +
      • +
      + + + +
        +
      • +

        deleteFolder

        +
        public static final boolean deleteFolder(java.lang.String folder)
        +
        Delete folder and its contents using specified folder path
        +
        +
        Parameters:
        +
        folder -
        +
        Returns:
        +
        boolean True if successful
        +
        +
      • +
      + + + +
        +
      • +

        secureWipeFolder

        +
        public static final void secureWipeFolder(java.lang.String folder)
        +
        Wipe folder and its contents using specified folder path
        +
        +
        Parameters:
        +
        folder -
        +
        +
      • +
      + + + +
        +
      • +

        secureWipeFolder

        +
        public static final void secureWipeFolder(java.io.File folder)
        +
        Wipe folder and its contents using specified File
        +
        +
        Parameters:
        +
        folder -
        +
        +
      • +
      + + + +
        +
      • +

        secureWipe

        +
        public static final void secureWipe(java.lang.String filename)
        +
        Wipe file using specified filename
        +
        +
        Parameters:
        +
        filename -
        +
        +
      • +
      + + + +
        +
      • +

        secureWipe

        +
        public static final void secureWipe(java.io.File f)
        +
        Wipe file using specified File
        +
        +
        Parameters:
        +
        f -
        +
        +
      • +
      + + + +
        +
      • +

        renameTo

        +
        public static final java.io.File renameTo(java.io.File f,
        +                                          java.lang.String newname)
        +
      • +
      + + + +
        +
      • +

        copyFolderContents

        +
        public static final void copyFolderContents(java.lang.String from,
        +                                            java.lang.String to,
        +                                            java.lang.String ignore)
        +
        Copy multiple files from one folder to another
        +
        +
        Parameters:
        +
        from - The from path
        +
        to - The to path
        +
        ignore -
        +
        +
      • +
      + + + +
        +
      • +

        getFilenames

        +
        public final java.lang.String[] getFilenames(int offset)
        +
        Returns an array of filenames, array if populated from the offset value + onwards
        +
        +
        Parameters:
        +
        offset -
        +
        Returns:
        +
        An array of filenames
        +
        +
      • +
      + + + +
        +
      • +

        exists

        +
        public final boolean exists()
        +
        Test to see if path exists
        +
        +
        Returns:
        +
        Returns true if file exists
        +
        +
      • +
      + + + +
        +
      • +

        exists

        +
        public static final boolean exists(java.lang.String pathname)
        +
        Test to see if path exists
        +
        +
        Parameters:
        +
        pathname - The pathname to check for
        +
        Returns:
        +
        Returns true if file exists
        +
        +
      • +
      + + + +
        +
      • +

        delete

        +
        public final boolean delete()
        +
        Deletes file
        +
        +
        Returns:
        +
        Returns true if successful
        +
        +
      • +
      + + + +
        +
      • +

        delete

        +
        public static final boolean delete(java.lang.String filename)
        +
        Deletes the specified file
        +
        +
        Parameters:
        +
        filename -
        +
        Returns:
        +
        Returns true if successful
        +
        +
      • +
      + + + +
        +
      • +

        renameFile

        +
        public final boolean renameFile(java.lang.String toname)
        +
        +
        Parameters:
        +
        toname -
        +
        Returns:
        +
        Returns true if successful
        +
        +
      • +
      + + + +
        +
      • +

        openBufferedRead

        +
        public final java.io.BufferedReader openBufferedRead()
        +
        Opens a buffered file for read
        +
        +
        Returns:
        +
        Returns null if failed
        +
        +
      • +
      + + + +
        +
      • +

        openBufferedResource

        +
        public final void openBufferedResource()
        +
        Use this if you need access to a file within a jar
        +
      • +
      + + + +
        +
      • +

        openBufferedAppend

        +
        public final void openBufferedAppend()
        +
        Opens a buffered file for append
        +
      • +
      + + + +
        +
      • +

        readLine

        +
        public final java.lang.String readLine()
        +
        Read a single line from a text file
        +
        +
        Returns:
        +
        Contents as String
        +
        +
      • +
      + + + +
        +
      • +

        readEntireFile

        +
        public final java.lang.String readEntireFile()
        +
        Read bytes from previously opened BufferedReader
        +
        +
        Returns:
        +
        Returns the entire contents from a file
        +
        +
      • +
      + + + +
        +
      • +

        openFileInputStream

        +
        public final java.io.FileInputStream openFileInputStream(java.lang.String filename)
        +
      • +
      + + + +
        +
      • +

        openFileOutputStream

        +
        public final java.io.FileOutputStream openFileOutputStream()
        +
        Opens a file output stream
        +
        +
        Returns:
        +
        Returns Opened file output stream
        +
        +
      • +
      + + + +
        +
      • +

        openBufferedWrite

        +
        public final void openBufferedWrite()
        +
        Opens a buffered file for write
        +
      • +
      + + + +
        +
      • +

        flushWriter

        +
        public final void flushWriter()
        +
      • +
      + + + +
        +
      • +

        writeFile

        +
        public final void writeFile(java.lang.String data,
        +                            int newlines)
        +
        Write to a previously opened output file
        +
        +
        Parameters:
        +
        data - The data to be written
        +
        newlines - The number of newlines to generate
        +
        +
      • +
      + + + +
        +
      • +

        writeFile

        +
        public final void writeFile(char[] data,
        +                            int nochars)
        +
        Write to a previously opened output file
        +
        +
        Parameters:
        +
        data - The character data to be written
        +
        nochars -
        +
        +
      • +
      + + + +
        +
      • +

        copyFromTo

        +
        public static final void copyFromTo(java.lang.String frompath,
        +                                    java.lang.String topath)
        +
        Copy file to
        +
        +
        Parameters:
        +
        frompath -
        +
        topath -
        +
        +
      • +
      + + + +
        +
      • +

        mergeFiles

        +
        public static final void mergeFiles(java.lang.String srcpath1,
        +                                    java.lang.String srcpath2,
        +                                    java.lang.String destpath)
        +
      • +
      + + + +
        +
      • +

        getAgeOfFile

        +
        public static final float getAgeOfFile(java.lang.String filepath,
        +                                       int period)
        +
        Get the age of a specified file
        +
        +
        Parameters:
        +
        filepath -
        +
        period -
        +
        Returns:
        +
        Age of file as float
        +
        +
      • +
      + + + +
        +
      • +

        isMinutesOlder

        +
        public static final boolean isMinutesOlder(java.lang.String filename,
        +                                           long minutes)
        +
        Test to see our file is older in minutes, returns true if it is
        +
        +
        Parameters:
        +
        filename -
        +
        minutes -
        +
        Returns:
        +
        boolean
        +
        +
      • +
      + + + +
        +
      • +

        isHoursOlder

        +
        public static final boolean isHoursOlder(java.lang.String filename,
        +                                         long hours)
        +
        Test to see our file is older in hours, returns true if it is
        +
        +
        Parameters:
        +
        filename -
        +
        hours -
        +
        Returns:
        +
        boolean
        +
        +
      • +
      + + + +
        +
      • +

        isDaysOlder

        +
        public static final boolean isDaysOlder(java.lang.String filename,
        +                                        long days)
        +
        Test to see our file is older in days, returns true if it is
        +
        +
        Parameters:
        +
        filename -
        +
        days -
        +
        Returns:
        +
        boolean
        +
        +
      • +
      + + + +
        +
      • +

        openZipStream

        +
        public final boolean openZipStream(int level)
        +
        Opens a zipstream. returns false if it fails
        +
        +
        Parameters:
        +
        level -
        +
        Returns:
        +
        an open zipstream
        +
        +
      • +
      + + + +
        +
      • +

        closeZipStream

        +
        public final void closeZipStream()
        +
        Close a zip stream
        +
      • +
      + + + +
        +
      • +

        compress

        +
        public static final void compress(java.lang.String source,
        +                                  java.lang.String dest)
        +
      • +
      + + + +
        +
      • +

        addFilesToZip

        +
        public final boolean addFilesToZip(java.io.File... srcfiles)
        +
        Add files to a zip file
        +
        +
        Parameters:
        +
        srcfiles - An array of Files
        +
        Returns:
        +
        boolean True if successful
        +
        +
      • +
      + + + +
        +
      • +

        extractZipTo

        +
        public final boolean extractZipTo(java.lang.String destpath)
        +
        Extracts a zip file to a supplied location
        +
        +
        Parameters:
        +
        destpath - Destination for contents of zip file
        +
        Returns:
        +
        True if successful
        +
        +
      • +
      + + + +
        +
      • +

        objectWrite

        +
        public static final boolean objectWrite(java.lang.String filepath,
        +                                        java.lang.Object o)
        +
      • +
      + + + +
        +
      • +

        objectRead

        +
        public static final java.lang.Object objectRead(java.lang.String filepath,
        +                                                java.lang.Object defObject)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/SimpleProps.html b/javadoc/lib/SimpleProps.html new file mode 100644 index 0000000..4d7a49b --- /dev/null +++ b/javadoc/lib/SimpleProps.html @@ -0,0 +1,563 @@ + + + + + + +SimpleProps (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class SimpleProps

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.SimpleProps
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class SimpleProps
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      SimpleProps(java.lang.String filepath, + java.lang.String comment) +
      Constructor, requires
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      booleandelete() +
      Delete the properties file store
      +
      booleangetBool(java.lang.String property) +
      Get a boolean property
      +
      java.lang.StringgetChangedProperties() +
      Get a comma separated list of properties that were changed
      +
      intgetInt(java.lang.String property) +
      Get an integer number property
      +
      longgetLong(java.lang.String property) +
      Get a long number property
      +
      java.lang.StringgetString(java.lang.String key) +
      Get a String property
      +
      voidload() +
      Load from xml file
      +
      voidresetToDefaults() +
      Reset to defaults
      +
      voidsave() +
      Save to xml file
      +
      voidsetBool(java.lang.String property, + boolean enabled) +
      Set a boolean property
      +
      voidsetDefaultModeEnabled(boolean enabled) +
      Enable/disable default mode
      +
      voidsetInt(java.lang.String property, + int num) +
      Set a integer number property
      +
      voidsetLong(java.lang.String property, + long num) +
      Set a long number property
      +
      java.lang.ObjectsetString(java.lang.String key, + java.lang.String value) +
      Set a String property
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SimpleProps

        +
        public SimpleProps(java.lang.String filepath,
        +                   java.lang.String comment)
        +
        Constructor, requires
        +
        +
        Parameters:
        +
        filepath -
        +
        comment -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setDefaultModeEnabled

        +
        public void setDefaultModeEnabled(boolean enabled)
        +
        Enable/disable default mode
        +
        +
        Parameters:
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        setLong

        +
        public void setLong(java.lang.String property,
        +                    long num)
        +
        Set a long number property
        +
        +
        Parameters:
        +
        property -
        +
        num -
        +
        +
      • +
      + + + +
        +
      • +

        getLong

        +
        public long getLong(java.lang.String property)
        +
        Get a long number property
        +
        +
        Parameters:
        +
        property -
        +
        Returns:
        +
        A long number
        +
        +
      • +
      + + + +
        +
      • +

        setInt

        +
        public void setInt(java.lang.String property,
        +                   int num)
        +
        Set a integer number property
        +
        +
        Parameters:
        +
        property -
        +
        num -
        +
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt(java.lang.String property)
        +
        Get an integer number property
        +
        +
        Parameters:
        +
        property -
        +
        Returns:
        +
        an integer
        +
        +
      • +
      + + + +
        +
      • +

        setBool

        +
        public void setBool(java.lang.String property,
        +                    boolean enabled)
        +
        Set a boolean property
        +
        +
        Parameters:
        +
        property -
        +
        enabled -
        +
        +
      • +
      + + + +
        +
      • +

        getBool

        +
        public boolean getBool(java.lang.String property)
        +
        Get a boolean property
        +
        +
        Parameters:
        +
        property -
        +
        Returns:
        +
        boolean
        +
        +
      • +
      + + + +
        +
      • +

        setString

        +
        public java.lang.Object setString(java.lang.String key,
        +                                  java.lang.String value)
        +
        Set a String property
        +
        +
        Parameters:
        +
        key -
        +
        value -
        +
        Returns:
        +
        String
        +
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public java.lang.String getString(java.lang.String key)
        +
        Get a String property
        +
        +
        Parameters:
        +
        key -
        +
        Returns:
        +
        String or null
        +
        +
      • +
      + + + +
        +
      • +

        save

        +
        public void save()
        +
        Save to xml file
        +
      • +
      + + + +
        +
      • +

        load

        +
        public void load()
        +
        Load from xml file
        +
      • +
      + + + +
        +
      • +

        delete

        +
        public boolean delete()
        +
        Delete the properties file store
        +
        +
        Returns:
        +
        true if successful
        +
        +
      • +
      + + + +
        +
      • +

        getChangedProperties

        +
        public java.lang.String getChangedProperties()
        +
        Get a comma separated list of properties that were changed
        +
        +
        Returns:
        +
        A String of property keys that were changed
        +
        +
      • +
      + + + +
        +
      • +

        resetToDefaults

        +
        public void resetToDefaults()
        +
        Reset to defaults
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/SwingTrayIcon.html b/javadoc/lib/SwingTrayIcon.html new file mode 100644 index 0000000..6c3a30a --- /dev/null +++ b/javadoc/lib/SwingTrayIcon.html @@ -0,0 +1,439 @@ + + + + + + +SwingTrayIcon (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class SwingTrayIcon

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.SwingTrayIcon
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class SwingTrayIcon
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      SwingTrayIcon(java.awt.GraphicsConfiguration gc, + java.lang.String resourcepath) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      voidaddMouseListener(java.awt.event.MouseListener ml) +
      Add a mouse listener
      +
      voiddisable() 
      voiddisplayMessage(java.lang.String title, + java.lang.String body) +
      Display desktop message (Windows only)
      +
      voiddispose() 
      booleanisLoaded() +
      Is tray icon loaded
      +
      booleanisSupported() 
      voidload() +
      Load tray icon
      +
      voidsetInfoTip(java.lang.String text) +
      Set info tip text
      +
      voidsetTrayPopupMenu(TrayPopupMenu tpm) +
      Set tray right click popup
      +
      voidunload() +
      Unload Tray icon
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SwingTrayIcon

        +
        public SwingTrayIcon(java.awt.GraphicsConfiguration gc,
        +                     java.lang.String resourcepath)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        dispose

        +
        public void dispose()
        +
      • +
      + + + +
        +
      • +

        disable

        +
        public void disable()
        +
      • +
      + + + +
        +
      • +

        setTrayPopupMenu

        +
        public void setTrayPopupMenu(TrayPopupMenu tpm)
        +
        Set tray right click popup
        +
        +
        Parameters:
        +
        tpm -
        +
        +
      • +
      + + + +
        +
      • +

        setInfoTip

        +
        public void setInfoTip(java.lang.String text)
        +
        Set info tip text
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        displayMessage

        +
        public void displayMessage(java.lang.String title,
        +                           java.lang.String body)
        +
        Display desktop message (Windows only)
        +
        +
        Parameters:
        +
        title -
        +
        body -
        +
        +
      • +
      + + + +
        +
      • +

        load

        +
        public void load()
        +
        Load tray icon
        +
      • +
      + + + +
        +
      • +

        unload

        +
        public void unload()
        +
        Unload Tray icon
        +
      • +
      + + + +
        +
      • +

        addMouseListener

        +
        public void addMouseListener(java.awt.event.MouseListener ml)
        +
        Add a mouse listener
        +
        +
        Parameters:
        +
        ml -
        +
        +
      • +
      + + + +
        +
      • +

        isLoaded

        +
        public boolean isLoaded()
        +
        Is tray icon loaded
        +
        +
        Returns:
        +
        ture if it is
        +
        +
      • +
      + + + +
        +
      • +

        isSupported

        +
        public boolean isSupported()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/TextResourceDialog.html b/javadoc/lib/TextResourceDialog.html new file mode 100644 index 0000000..f66b5e0 --- /dev/null +++ b/javadoc/lib/TextResourceDialog.html @@ -0,0 +1,525 @@ + + + + + + +TextResourceDialog (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class TextResourceDialog

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • java.awt.Window
        • +
        • +
            +
          • java.awt.Dialog
          • +
          • +
              +
            • javax.swing.JDialog
            • +
            • +
                +
              • lib.TextResourceDialog
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
    +
    +
    +
    +
    public class TextResourceDialog
    +extends javax.swing.JDialog
    +
    +
    Author:
    +
    Alistair Neil
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JDialog

        +javax.swing.JDialog.AccessibleJDialog
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Dialog

        +java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Window

        +java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javax.swing.JDialog

        +accessibleContext, rootPane, rootPaneCheckingEnabled
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Dialog

        +DEFAULT_MODALITY_TYPE
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface javax.swing.WindowConstants

        +DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TextResourceDialog(java.awt.Frame parent, + boolean modal) +
      Creates new License Dialog
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      java.lang.StringgetText() +
      Get the license text
      +
      voidsetButtonURL(java.lang.String url) +
      Set the browser url for unnoficial translation
      +
      voidsetCloseButtonText(java.lang.String text) +
      Set the text on the Close button
      +
      voidsetText(java.lang.String text) +
      Set the license text
      +
      voidsetURLButtonText(java.lang.String text) +
      Set the text on the Close button
      +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JDialog

        +addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Dialog

        +addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Window

        +addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TextResourceDialog

        +
        public TextResourceDialog(java.awt.Frame parent,
        +                          boolean modal)
        +
        Creates new License Dialog
        +
        +
        Parameters:
        +
        parent -
        +
        modal -
        +
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setButtonURL

        +
        public void setButtonURL(java.lang.String url)
        +
        Set the browser url for unnoficial translation
        +
        +
        Parameters:
        +
        url -
        +
        +
      • +
      + + + +
        +
      • +

        getText

        +
        public java.lang.String getText()
        +
        Get the license text
        +
        +
        Returns:
        +
        Text
        +
        +
      • +
      + + + +
        +
      • +

        setText

        +
        public void setText(java.lang.String text)
        +
        Set the license text
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        setCloseButtonText

        +
        public void setCloseButtonText(java.lang.String text)
        +
        Set the text on the Close button
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      + + + +
        +
      • +

        setURLButtonText

        +
        public void setURLButtonText(java.lang.String text)
        +
        Set the text on the Close button
        +
        +
        Parameters:
        +
        text -
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/TrayPopupMenu.html b/javadoc/lib/TrayPopupMenu.html new file mode 100644 index 0000000..0d0c037 --- /dev/null +++ b/javadoc/lib/TrayPopupMenu.html @@ -0,0 +1,450 @@ + + + + + + +TrayPopupMenu (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class TrayPopupMenu

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.awt.Component
    • +
    • +
        +
      • java.awt.Container
      • +
      • +
          +
        • javax.swing.JComponent
        • +
        • +
            +
          • javax.swing.JPopupMenu
          • +
          • +
              +
            • lib.TrayPopupMenu
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.MenuElement
    +
    +
    +
    +
    public class TrayPopupMenu
    +extends javax.swing.JPopupMenu
    +
    +
    Author:
    +
    Alistair Neil
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JPopupMenu

        +javax.swing.JPopupMenu.AccessibleJPopupMenu, javax.swing.JPopupMenu.Separator
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class javax.swing.JComponent

        +javax.swing.JComponent.AccessibleJComponent
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Container

        +java.awt.Container.AccessibleAWTContainer
      • +
      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.awt.Component

        +java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
      • +
      +
    • +
    + +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class javax.swing.JComponent

        +listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • +
      +
        +
      • + + +

        Fields inherited from class java.awt.Component

        +accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • +
      +
        +
      • + + +

        Fields inherited from interface java.awt.image.ImageObserver

        +ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • +
      +
    • +
    + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      TrayPopupMenu() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethod and Description
      javax.swing.JMenuItemadd(javax.swing.JMenuItem mi) 
      voidpaintComponent(java.awt.Graphics g) 
      voidsetBackground(java.awt.Color bg) 
      voidsetForeground(java.awt.Color fg) 
      +
        +
      • + + +

        Methods inherited from class javax.swing.JPopupMenu

        +add, add, addMenuKeyListener, addPopupMenuListener, addSeparator, createActionChangeListener, createActionComponent, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getMenuKeyListeners, getPopupMenuListeners, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processFocusEvent, processKeyEvent, processKeyEvent, processMouseEvent, remove, removeMenuKeyListener, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show, updateUI
      • +
      +
        +
      • + + +

        Methods inherited from class javax.swing.JComponent

        +addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Container

        +add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
      • +
      +
        +
      • + + +

        Methods inherited from class java.awt.Component

        +action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TrayPopupMenu

        +
        public TrayPopupMenu()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        public javax.swing.JMenuItem add(javax.swing.JMenuItem mi)
        +
        +
        Overrides:
        +
        add in class javax.swing.JPopupMenu
        +
        +
      • +
      + + + +
        +
      • +

        setForeground

        +
        public void setForeground(java.awt.Color fg)
        +
        +
        Overrides:
        +
        setForeground in class javax.swing.JComponent
        +
        +
      • +
      + + + +
        +
      • +

        setBackground

        +
        public void setBackground(java.awt.Color bg)
        +
        +
        Overrides:
        +
        setBackground in class javax.swing.JComponent
        +
        +
      • +
      + + + +
        +
      • +

        paintComponent

        +
        public void paintComponent(java.awt.Graphics g)
        +
        +
        Overrides:
        +
        paintComponent in class javax.swing.JComponent
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/Utilities.html b/javadoc/lib/Utilities.html new file mode 100644 index 0000000..060b469 --- /dev/null +++ b/javadoc/lib/Utilities.html @@ -0,0 +1,613 @@ + + + + + + +Utilities (SelekTOR Java Documentation) + + + + + + + + + + + + +
+
lib
+

Class Utilities

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • lib.Utilities
    • +
    +
  • +
+
+
    +
  • +
    +
    +
    public final class Utilities
    +extends java.lang.Object
    +
    +
    Author:
    +
    Alistair Neil
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Utilities() +
      Constructor
      +
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethod and Description
      static voidadjustTableColumnWidth(javax.swing.JTable table, + java.lang.String... test) +
      Adjust specified column width based on the width of a test string
      +
      static voideditFile(java.lang.String path) +
      Open the desktop default file editor
      +
      static java.lang.StringgenerateSecretKey(int length) +
      Generate secret key.
      +
      static java.lang.StringgetListAsCSV(java.util.ArrayList<java.lang.String> al) +
      Covert list to csv
      +
      static java.lang.StringgetSha1Sum(java.lang.String filepath) +
      Calculate the sha1 checksum of a given file
      +
      static java.lang.StringgetSHAHash(java.lang.String password) +
      Get SHAHash using given password string
      +
      static java.lang.StringgetTextFromFile(java.lang.String filepath) +
      Retrieve text from a text file
      +
      static java.lang.StringgetTextFromResource(java.lang.String resourcepath) +
      Retrieve text from a resource text file
      +
      static java.lang.StringgetTorHashPassword(java.lang.String secret) 
      static booleanisNewerVersion(java.lang.String localversion, + java.lang.String remoteversion) +
      Check for newer appversion
      +
      static voidloadUIStyle(java.lang.String theme) +
      Initialises the UI Look and Feel
      +
      static java.lang.StringopenFileChooser(java.awt.Frame parent, + java.lang.String folder, + javax.swing.filechooser.FileFilter filter, + int mode) +
      Opens java file chooser dialog, convenience method.
      +
      static booleanopenFileExternally(java.lang.String strUrl) +
      Launch the desktops default file handling program
      +
      static voidpreloadFileChooser() +
      Preloads filechooser in background so it will open instantly when + requested
      +
      static voidregisterWindow() +
      Creates a hidden dummy window for registration to various docks/launchers + Fixes the neverending launching indicator
      +
      static byte[]S2KRFC2440(java.lang.String secret) +
      Secret to key, Algorithm info taken from + http://sunsite.icm.edu.pl/gnupg/rfc2440-3.html
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Utilities

        +
        public Utilities()
        +
        Constructor
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getListAsCSV

        +
        public static java.lang.String getListAsCSV(java.util.ArrayList<java.lang.String> al)
        +
        Covert list to csv
        +
        +
        Parameters:
        +
        al -
        +
        Returns:
        +
        String of comma separated values
        +
        +
      • +
      + + + +
        +
      • +

        preloadFileChooser

        +
        public static void preloadFileChooser()
        +
        Preloads filechooser in background so it will open instantly when + requested
        +
      • +
      + + + +
        +
      • +

        openFileChooser

        +
        public static java.lang.String openFileChooser(java.awt.Frame parent,
        +                                               java.lang.String folder,
        +                                               javax.swing.filechooser.FileFilter filter,
        +                                               int mode)
        +
        Opens java file chooser dialog, convenience method. Returns filepath if + successful and null if not
        +
        +
        Parameters:
        +
        parent -
        +
        folder -
        +
        filter - Extension filter
        +
        mode - Fileselection mode
        +
        Returns:
        +
        String Filepath
        +
        +
      • +
      + + + +
        +
      • +

        isNewerVersion

        +
        public static boolean isNewerVersion(java.lang.String localversion,
        +                                     java.lang.String remoteversion)
        +
        Check for newer appversion
        +
        +
        Parameters:
        +
        localversion -
        +
        remoteversion -
        +
        Returns:
        +
        True if newer
        +
        +
      • +
      + + + +
        +
      • +

        editFile

        +
        public static void editFile(java.lang.String path)
        +
        Open the desktop default file editor
        +
        +
        Parameters:
        +
        path - Path to file
        +
        +
      • +
      + + + +
        +
      • +

        openFileExternally

        +
        public static boolean openFileExternally(java.lang.String strUrl)
        +
        Launch the desktops default file handling program
        +
        +
        Parameters:
        +
        strUrl -
        +
        Returns:
        +
        Returns true if successful
        +
        +
      • +
      + + + +
        +
      • +

        loadUIStyle

        +
        public static void loadUIStyle(java.lang.String theme)
        +
        Initialises the UI Look and Feel
        +
        +
        Parameters:
        +
        theme -
        +
        +
      • +
      + + + +
        +
      • +

        adjustTableColumnWidth

        +
        public static void adjustTableColumnWidth(javax.swing.JTable table,
        +                                          java.lang.String... test)
        +
        Adjust specified column width based on the width of a test string
        +
        +
        Parameters:
        +
        table -
        +
        test -
        +
        +
      • +
      + + + +
        +
      • +

        generateSecretKey

        +
        public static java.lang.String generateSecretKey(int length)
        +
        Generate secret key.
        +
        +
        Parameters:
        +
        length -
        +
        Returns:
        +
        String key
        +
        +
      • +
      + + + +
        +
      • +

        getTorHashPassword

        +
        public static java.lang.String getTorHashPassword(java.lang.String secret)
        +
      • +
      + + + +
        +
      • +

        S2KRFC2440

        +
        public static byte[] S2KRFC2440(java.lang.String secret)
        +
        Secret to key, Algorithm info taken from + http://sunsite.icm.edu.pl/gnupg/rfc2440-3.html
        +
        +
        Parameters:
        +
        secret -
        +
        Returns:
        +
        hashed key for the given secret
        +
        +
      • +
      + + + +
        +
      • +

        getSHAHash

        +
        public static java.lang.String getSHAHash(java.lang.String password)
        +
        Get SHAHash using given password string
        +
        +
        Parameters:
        +
        password -
        +
        Returns:
        +
        SHAhash string
        +
        +
      • +
      + + + +
        +
      • +

        getTextFromResource

        +
        public static java.lang.String getTextFromResource(java.lang.String resourcepath)
        +
        Retrieve text from a resource text file
        +
        +
        Parameters:
        +
        resourcepath -
        +
        Returns:
        +
        String text
        +
        +
      • +
      + + + +
        +
      • +

        getTextFromFile

        +
        public static java.lang.String getTextFromFile(java.lang.String filepath)
        +
        Retrieve text from a text file
        +
        +
        Parameters:
        +
        filepath -
        +
        Returns:
        +
        String text
        +
        +
      • +
      + + + +
        +
      • +

        getSha1Sum

        +
        public static java.lang.String getSha1Sum(java.lang.String filepath)
        +
        Calculate the sha1 checksum of a given file
        +
        +
        Parameters:
        +
        filepath -
        +
        Returns:
        +
        Checksum as a hex string
        +
        +
      • +
      + + + +
        +
      • +

        registerWindow

        +
        public static void registerWindow()
        +
        Creates a hidden dummy window for registration to various docks/launchers + Fixes the neverending launching indicator
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/javadoc/lib/class-use/AboutDialog.html b/javadoc/lib/class-use/AboutDialog.html new file mode 100644 index 0000000..a32fa30 --- /dev/null +++ b/javadoc/lib/class-use/AboutDialog.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.AboutDialog (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.AboutDialog

+
+
No usage of lib.AboutDialog
+ + + + + + diff --git a/javadoc/lib/class-use/ClientProcess.html b/javadoc/lib/class-use/ClientProcess.html new file mode 100644 index 0000000..131f398 --- /dev/null +++ b/javadoc/lib/class-use/ClientProcess.html @@ -0,0 +1,169 @@ + + + + + + +Uses of Class lib.ClientProcess (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.ClientProcess

+
+
+ +
+ + + + + + diff --git a/javadoc/lib/class-use/DesktopNotify.html b/javadoc/lib/class-use/DesktopNotify.html new file mode 100644 index 0000000..5f209c8 --- /dev/null +++ b/javadoc/lib/class-use/DesktopNotify.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.DesktopNotify (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.DesktopNotify

+
+
No usage of lib.DesktopNotify
+ + + + + + diff --git a/javadoc/lib/class-use/ExtensionFileFilter.html b/javadoc/lib/class-use/ExtensionFileFilter.html new file mode 100644 index 0000000..5f33009 --- /dev/null +++ b/javadoc/lib/class-use/ExtensionFileFilter.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.ExtensionFileFilter (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.ExtensionFileFilter

+
+
No usage of lib.ExtensionFileFilter
+ + + + + + diff --git a/javadoc/lib/class-use/GTKFixes.html b/javadoc/lib/class-use/GTKFixes.html new file mode 100644 index 0000000..cee214f --- /dev/null +++ b/javadoc/lib/class-use/GTKFixes.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.GTKFixes (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.GTKFixes

+
+
No usage of lib.GTKFixes
+ + + + + + diff --git a/javadoc/lib/class-use/InfoDialog.html b/javadoc/lib/class-use/InfoDialog.html new file mode 100644 index 0000000..264d0f9 --- /dev/null +++ b/javadoc/lib/class-use/InfoDialog.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.InfoDialog (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.InfoDialog

+
+
No usage of lib.InfoDialog
+ + + + + + diff --git a/javadoc/lib/class-use/Localisation.html b/javadoc/lib/class-use/Localisation.html new file mode 100644 index 0000000..4d017d5 --- /dev/null +++ b/javadoc/lib/class-use/Localisation.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.Localisation (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.Localisation

+
+
No usage of lib.Localisation
+ + + + + + diff --git a/javadoc/lib/class-use/NetFunctions.HttpPage.html b/javadoc/lib/class-use/NetFunctions.HttpPage.html new file mode 100644 index 0000000..5b50286 --- /dev/null +++ b/javadoc/lib/class-use/NetFunctions.HttpPage.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.NetFunctions.HttpPage (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.NetFunctions.HttpPage

+
+
No usage of lib.NetFunctions.HttpPage
+ + + + + + diff --git a/javadoc/lib/class-use/NetFunctions.html b/javadoc/lib/class-use/NetFunctions.html new file mode 100644 index 0000000..d17d9e4 --- /dev/null +++ b/javadoc/lib/class-use/NetFunctions.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.NetFunctions (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.NetFunctions

+
+
No usage of lib.NetFunctions
+ + + + + + diff --git a/javadoc/lib/class-use/OSFunction.html b/javadoc/lib/class-use/OSFunction.html new file mode 100644 index 0000000..e57351b --- /dev/null +++ b/javadoc/lib/class-use/OSFunction.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.OSFunction (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.OSFunction

+
+
No usage of lib.OSFunction
+ + + + + + diff --git a/javadoc/lib/class-use/SimpleFile.html b/javadoc/lib/class-use/SimpleFile.html new file mode 100644 index 0000000..f79c7e5 --- /dev/null +++ b/javadoc/lib/class-use/SimpleFile.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.SimpleFile (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.SimpleFile

+
+
No usage of lib.SimpleFile
+ + + + + + diff --git a/javadoc/lib/class-use/SimpleProps.html b/javadoc/lib/class-use/SimpleProps.html new file mode 100644 index 0000000..cb3dd66 --- /dev/null +++ b/javadoc/lib/class-use/SimpleProps.html @@ -0,0 +1,167 @@ + + + + + + +Uses of Class lib.SimpleProps (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.SimpleProps

+
+
+ +
+ + + + + + diff --git a/javadoc/lib/class-use/SwingTrayIcon.html b/javadoc/lib/class-use/SwingTrayIcon.html new file mode 100644 index 0000000..3589ad1 --- /dev/null +++ b/javadoc/lib/class-use/SwingTrayIcon.html @@ -0,0 +1,164 @@ + + + + + + +Uses of Class lib.SwingTrayIcon (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.SwingTrayIcon

+
+
+ +
+ + + + + + diff --git a/javadoc/lib/class-use/TextResourceDialog.html b/javadoc/lib/class-use/TextResourceDialog.html new file mode 100644 index 0000000..096680c --- /dev/null +++ b/javadoc/lib/class-use/TextResourceDialog.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.TextResourceDialog (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.TextResourceDialog

+
+
No usage of lib.TextResourceDialog
+ + + + + + diff --git a/javadoc/lib/class-use/TrayPopupMenu.html b/javadoc/lib/class-use/TrayPopupMenu.html new file mode 100644 index 0000000..3d12788 --- /dev/null +++ b/javadoc/lib/class-use/TrayPopupMenu.html @@ -0,0 +1,171 @@ + + + + + + +Uses of Class lib.TrayPopupMenu (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.TrayPopupMenu

+
+
+ +
+ + + + + + diff --git a/javadoc/lib/class-use/Utilities.html b/javadoc/lib/class-use/Utilities.html new file mode 100644 index 0000000..eef38d6 --- /dev/null +++ b/javadoc/lib/class-use/Utilities.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Class lib.Utilities (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Class
lib.Utilities

+
+
No usage of lib.Utilities
+ + + + + + diff --git a/javadoc/lib/package-frame.html b/javadoc/lib/package-frame.html new file mode 100644 index 0000000..ec90b75 --- /dev/null +++ b/javadoc/lib/package-frame.html @@ -0,0 +1,36 @@ + + + + + + +lib (SelekTOR Java Documentation) + + + + + +

lib

+ + + diff --git a/javadoc/lib/package-summary.html b/javadoc/lib/package-summary.html new file mode 100644 index 0000000..d20d5ab --- /dev/null +++ b/javadoc/lib/package-summary.html @@ -0,0 +1,207 @@ + + + + + + +lib (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Package lib

+
+
+ +
+ + + + + + diff --git a/javadoc/lib/package-tree.html b/javadoc/lib/package-tree.html new file mode 100644 index 0000000..887da49 --- /dev/null +++ b/javadoc/lib/package-tree.html @@ -0,0 +1,185 @@ + + + + + + +lib Class Hierarchy (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Hierarchy For Package lib

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/javadoc/lib/package-use.html b/javadoc/lib/package-use.html new file mode 100644 index 0000000..0f291a1 --- /dev/null +++ b/javadoc/lib/package-use.html @@ -0,0 +1,183 @@ + + + + + + +Uses of Package lib (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Package
lib

+
+
+ +
+ + + + + + diff --git a/javadoc/overview-frame.html b/javadoc/overview-frame.html new file mode 100644 index 0000000..20c247c --- /dev/null +++ b/javadoc/overview-frame.html @@ -0,0 +1,24 @@ + + + + + + +Overview List (SelekTOR Java Documentation) + + + + + + +
+

Packages

+ +
+

 

+ + diff --git a/javadoc/overview-summary.html b/javadoc/overview-summary.html new file mode 100644 index 0000000..b850755 --- /dev/null +++ b/javadoc/overview-summary.html @@ -0,0 +1,140 @@ + + + + + + +Overview (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + +
Packages 
PackageDescription
client 
lib 
+
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/overview-tree.html b/javadoc/overview-tree.html new file mode 100644 index 0000000..f2b6e1b --- /dev/null +++ b/javadoc/overview-tree.html @@ -0,0 +1,233 @@ + + + + + + +Class Hierarchy (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
+

Hierarchy For All Packages

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/package-frame.html b/javadoc/package-frame.html new file mode 100644 index 0000000..d833879 --- /dev/null +++ b/javadoc/package-frame.html @@ -0,0 +1,21 @@ + + + + + + +<Unnamed> (SelekTOR Java Documentation) + + + + + +

<Unnamed>

+
+

Classes

+ +
+ + diff --git a/javadoc/package-list b/javadoc/package-list new file mode 100644 index 0000000..c2030fd --- /dev/null +++ b/javadoc/package-list @@ -0,0 +1,3 @@ + +client +lib diff --git a/javadoc/package-summary.html b/javadoc/package-summary.html new file mode 100644 index 0000000..6d3ebf6 --- /dev/null +++ b/javadoc/package-summary.html @@ -0,0 +1,145 @@ + + + + + + + (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Package <Unnamed>

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    SelekTOR +
    Explanation of why this is in the default package
    +
    +
  • +
+
+ + + + + + diff --git a/javadoc/package-tree.html b/javadoc/package-tree.html new file mode 100644 index 0000000..7d54e17 --- /dev/null +++ b/javadoc/package-tree.html @@ -0,0 +1,138 @@ + + + + + + + Class Hierarchy (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Hierarchy For Package <Unnamed>

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/javadoc/package-use.html b/javadoc/package-use.html new file mode 100644 index 0000000..e805df1 --- /dev/null +++ b/javadoc/package-use.html @@ -0,0 +1,125 @@ + + + + + + +Uses of Package (SelekTOR Java Documentation) + + + + + + + + + + + +
+

Uses of Package

+
+
No usage of
+ + + + + + diff --git a/javadoc/script.js b/javadoc/script.js new file mode 100644 index 0000000..b346356 --- /dev/null +++ b/javadoc/script.js @@ -0,0 +1,30 @@ +function show(type) +{ + count = 0; + for (var key in methods) { + var row = document.getElementById(key); + if ((methods[key] & type) != 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) +{ + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} diff --git a/javadoc/serialized-form.html b/javadoc/serialized-form.html new file mode 100644 index 0000000..98c7269 --- /dev/null +++ b/javadoc/serialized-form.html @@ -0,0 +1,1247 @@ + + + + + + +Serialized Form (SelekTOR Java Documentation) + + + + + + + + +
+ + + + + + + +
+ + +
+

Serialized Form

+
+
+
    +
  • +

    Package client

    +
      +
    • + + +

      Class client.ExitNodeTableModel extends javax.swing.table.DefaultTableModel implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          salFinger

          +
          java.util.List<E> salFinger
          +
        • +
        • +

          columnNames

          +
          java.lang.String[] columnNames
          +
        • +
        • +

          ni

          +
          NodeItem ni
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class client.GuardNodeDialog extends javax.swing.JDialog implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          intRowSelected

          +
          int intRowSelected
          +
        • +
        • +

          returnStatus

          +
          int returnStatus
          +
        • +
        • +

          gntm

          +
          GuardNodeTableModel gntm
          +
        • +
        • +

          nl

          +
          NodeList nl
          +
        • +
        • +

          jButtonApply

          +
          javax.swing.JButton jButtonApply
          +
        • +
        • +

          jButtonClear

          +
          javax.swing.JButton jButtonClear
          +
        • +
        • +

          jButtonClose

          +
          javax.swing.JButton jButtonClose
          +
        • +
        • +

          jMenuNodeDetails

          +
          javax.swing.JMenuItem jMenuNodeDetails
          +
        • +
        • +

          jMenuWhois

          +
          javax.swing.JMenuItem jMenuWhois
          +
        • +
        • +

          jScrollPane1

          +
          javax.swing.JScrollPane jScrollPane1
          +
        • +
        • +

          jTableGuards

          +
          javax.swing.JTable jTableGuards
          +
        • +
        • +

          jTextArea1

          +
          javax.swing.JTextArea jTextArea1
          +
        • +
        • +

          popupTable

          +
          javax.swing.JPopupMenu popupTable
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class client.GuardNodeTableModel extends javax.swing.table.DefaultTableModel implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          salFinger

          +
          java.util.List<E> salFinger
          +
        • +
        • +

          columnNames

          +
          java.lang.String[] columnNames
          +
        • +
        • +

          ni

          +
          NodeItem ni
          +
        • +
        • +

          enabledcount

          +
          int enabledcount
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class client.PatternsEditor extends javax.swing.JDialog implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          pactm

          +
          PatternsEditor.PACTableModel pactm
          +
        • +
        • +

          pacFactory

          +
          PacFactory pacFactory
          +
        • +
        • +

          strChange

          +
          java.lang.String strChange
          +
        • +
        • +

          parent

          +
          java.awt.Frame parent
          +
        • +
        • +

          strSelectedCountry

          +
          java.lang.String strSelectedCountry
          +
        • +
        • +

          jButtonAddPattern

          +
          javax.swing.JButton jButtonAddPattern
          +
        • +
        • +

          jButtonCancel

          +
          javax.swing.JButton jButtonCancel
          +
        • +
        • +

          jButtonDeletePattern

          +
          javax.swing.JButton jButtonDeletePattern
          +
        • +
        • +

          jButtonSave

          +
          javax.swing.JButton jButtonSave
          +
        • +
        • +

          jComboCountry

          +
          javax.swing.JComboBox<E> jComboCountry
          +
        • +
        • +

          jLabel1

          +
          javax.swing.JLabel jLabel1
          +
        • +
        • +

          jLabel17

          +
          javax.swing.JLabel jLabel17
          +
        • +
        • +

          jScrollPane1

          +
          javax.swing.JScrollPane jScrollPane1
          +
        • +
        • +

          jTablePatterns

          +
          javax.swing.JTable jTablePatterns
          +
        • +
        • +

          jTextDoNotProxy

          +
          javax.swing.JTextField jTextDoNotProxy
          +
        • +
        • +

          returnStatus

          +
          int returnStatus
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class client.PatternsEditor.CustomTableCellRenderer extends javax.swing.table.DefaultTableCellRenderer implements Serializable

      +
    • +
    • + + +

      Class client.PatternsEditor.PACTableModel extends javax.swing.table.DefaultTableModel implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          columnNames

          +
          java.lang.String[] columnNames
          +
        • +
        • +

          types

          +
          java.lang.Class<T>[] types
          +
        • +
        • +

          rowedit

          +
          java.util.ArrayList<E> rowedit
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class client.PrefsDialog extends javax.swing.JDialog implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          sp

          +
          SimpleProps sp
          +
        • +
        • +

          disabledprefs

          +
          java.lang.String disabledprefs
          +
        • +
        • +

          jButtonApply

          +
          javax.swing.JButton jButtonApply
          +
        • +
        • +

          jButtonCancel

          +
          javax.swing.JButton jButtonCancel
          +
        • +
        • +

          jButtonDefaults

          +
          javax.swing.JButton jButtonDefaults
          +
        • +
        • +

          jButtonGetBridges

          +
          javax.swing.JButton jButtonGetBridges
          +
        • +
        • +

          jCheckAppUpdate

          +
          javax.swing.JCheckBox jCheckAppUpdate
          +
        • +
        • +

          jCheckAutostart

          +
          javax.swing.JCheckBox jCheckAutostart
          +
        • +
        • +

          jCheckAvoidDisk

          +
          javax.swing.JCheckBox jCheckAvoidDisk
          +
        • +
        • +

          jCheckCacheDelete

          +
          javax.swing.JCheckBox jCheckCacheDelete
          +
        • +
        • +

          jCheckDisableNotify

          +
          javax.swing.JCheckBox jCheckDisableNotify
          +
        • +
        • +

          jCheckDisableTray

          +
          javax.swing.JCheckBox jCheckDisableTray
          +
        • +
        • +

          jCheckGeoUpdate

          +
          javax.swing.JCheckBox jCheckGeoUpdate
          +
        • +
        • +

          jCheckHideMin

          +
          javax.swing.JCheckBox jCheckHideMin
          +
        • +
        • +

          jCheckHideTray

          +
          javax.swing.JCheckBox jCheckHideTray
          +
        • +
        • +

          jCheckMinOnClose

          +
          javax.swing.JCheckBox jCheckMinOnClose
          +
        • +
        • +

          jCheckSafeLog

          +
          javax.swing.JCheckBox jCheckSafeLog
          +
        • +
        • +

          jCheckSafeSocks

          +
          javax.swing.JCheckBox jCheckSafeSocks
          +
        • +
        • +

          jCheckTestSocks

          +
          javax.swing.JCheckBox jCheckTestSocks
          +
        • +
        • +

          jComboLogLev

          +
          javax.swing.JComboBox<E> jComboLogLev
          +
        • +
        • +

          jLabel11

          +
          javax.swing.JLabel jLabel11
          +
        • +
        • +

          jLabel12

          +
          javax.swing.JLabel jLabel12
          +
        • +
        • +

          jLabel13

          +
          javax.swing.JLabel jLabel13
          +
        • +
        • +

          jLabel14

          +
          javax.swing.JLabel jLabel14
          +
        • +
        • +

          jLabel15

          +
          javax.swing.JLabel jLabel15
          +
        • +
        • +

          jLabel16

          +
          javax.swing.JLabel jLabel16
          +
        • +
        • +

          jLabel6

          +
          javax.swing.JLabel jLabel6
          +
        • +
        • +

          jLabelPortRanges

          +
          javax.swing.JLabel jLabelPortRanges
          +
        • +
        • +

          jPanel1

          +
          javax.swing.JPanel jPanel1
          +
        • +
        • +

          jPanelAdvancedPrefs

          +
          javax.swing.JPanel jPanelAdvancedPrefs
          +
        • +
        • +

          jPanelBasicPrefs

          +
          javax.swing.JPanel jPanelBasicPrefs
          +
        • +
        • +

          jPanelGeneralPrefs

          +
          javax.swing.JPanel jPanelGeneralPrefs
          +
        • +
        • +

          jPanelTorPrefs

          +
          javax.swing.JPanel jPanelTorPrefs
          +
        • +
        • +

          jSpinnerMainPort

          +
          javax.swing.JSpinner jSpinnerMainPort
          +
        • +
        • +

          jTabPrefs

          +
          javax.swing.JTabbedPane jTabPrefs
          +
        • +
        • +

          jTextHTTPProxy

          +
          javax.swing.JTextField jTextHTTPProxy
          +
        • +
        • +

          jTextTorArgs

          +
          javax.swing.JTextField jTextTorArgs
          +
        • +
        • +

          jTextTorBridge

          +
          javax.swing.JTextField jTextTorBridge
          +
        • +
        • +

          returnStatus

          +
          int returnStatus
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class client.QuickAddDialog extends javax.swing.JDialog implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          jButtonApply

          +
          javax.swing.JButton jButtonApply
          +
        • +
        • +

          jButtonCancel

          +
          javax.swing.JButton jButtonCancel
          +
        • +
        • +

          jLabel1

          +
          javax.swing.JLabel jLabel1
          +
        • +
        • +

          jLabel2

          +
          javax.swing.JLabel jLabel2
          +
        • +
        • +

          jPanelPreferences

          +
          javax.swing.JPanel jPanelPreferences
          +
        • +
        • +

          jTextDescription

          +
          javax.swing.JTextField jTextDescription
          +
        • +
        • +

          jTextPattern

          +
          javax.swing.JTextField jTextPattern
          +
        • +
        • +

          returnStatus

          +
          int returnStatus
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class client.SelekTOR extends javax.swing.JFrame implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          clientLocation

          +
          java.lang.String clientLocation
          +
        • +
        • +

          settingsPath

          +
          java.lang.String settingsPath
          +
        • +
        • +

          cachePath

          +
          java.lang.String cachePath
          +
        • +
        • +

          defaultGeoipPath

          +
          java.lang.String defaultGeoipPath
          +
        • +
        • +

          geoipPath

          +
          java.lang.String geoipPath
          +
        • +
        • +

          geoip6Path

          +
          java.lang.String geoip6Path
          +
        • +
        • +

          iconPath

          +
          java.lang.String iconPath
          +
        • +
        • +

          tcMain

          +
          TorController tcMain
          +
        • +
        • +

          nodeList

          +
          NodeList nodeList
          +
        • +
        • +

          pacFactory

          +
          PacFactory pacFactory
          +
        • +
        • +

          strExitISOCode

          +
          java.lang.String strExitISOCode
          +
        • +
        • +

          strRequestedExit

          +
          java.lang.String strRequestedExit
          +
        • +
        • +

          niActiveGuard

          +
          NodeItem niActiveGuard
          +
        • +
        • +

          niActiveMiddle

          +
          NodeItem niActiveMiddle
          +
        • +
        • +

          niActiveExit

          +
          NodeItem niActiveExit
          +
        • +
        • +

          intRowSelected

          +
          int intRowSelected
          +
        • +
        • +

          entm

          +
          ExitNodeTableModel entm
          +
        • +
        • +

          sp

          +
          SimpleProps sp
          +
        • +
        • +

          alTestThreads

          +
          java.util.ArrayList<E> alTestThreads
          +
        • +
        • +

          intActiveNodeTests

          +
          int intActiveNodeTests
          +
        • +
        • +

          intBestNodeIndex

          +
          int intBestNodeIndex
          +
        • +
        • +

          strArrBestNodes

          +
          java.lang.String[] strArrBestNodes
          +
        • +
        • +

          lngThreshold

          +
          long lngThreshold
          +
        • +
        • +

          intThresholdExceeded

          +
          int intThresholdExceeded
          +
        • +
        • +

          nf

          +
          NetFunctions nf
          +
        • +
        • +

          boolNetEnabled

          +
          boolean boolNetEnabled
          +
        • +
        • +

          strSecret

          +
          java.lang.String strSecret
          +
        • +
        • +

          strHash

          +
          java.lang.String strHash
          +
        • +
        • +

          alTestQueue

          +
          java.util.ArrayList<E> alTestQueue
          +
        • +
        • +

          tmr

          +
          javax.swing.Timer tmr
          +
        • +
        • +

          intBeginTesting

          +
          int intBeginTesting
          +
        • +
        • +

          intLatencyCheck

          +
          int intLatencyCheck
          +
        • +
        • +

          intAutoSelectCheck

          +
          int intAutoSelectCheck
          +
        • +
        • +

          lngHibernateTimeStamp

          +
          long lngHibernateTimeStamp
          +
        • +
        • +

          boolFirstRun

          +
          boolean boolFirstRun
          +
        • +
        • +

          alArgs

          +
          java.util.ArrayList<E> alArgs
          +
        • +
        • +

          tmf

          +
          TorMonFrame tmf
          +
        • +
        • +

          startupDelay

          +
          long startupDelay
          +
        • +
        • +

          dn

          +
          DesktopNotify dn
          +
        • +
        • +

          sti

          +
          SwingTrayIcon sti
          +
        • +
        • +

          desktopname

          +
          java.lang.String desktopname
          +
        • +
        • +

          compositor

          +
          java.lang.String compositor
          +
        • +
        • +

          updateCheckDisabled

          +
          boolean updateCheckDisabled
          +
        • +
        • +

          buttonGroupProxy

          +
          javax.swing.ButtonGroup buttonGroupProxy
          +
        • +
        • +

          buttonGroupProxyTray

          +
          javax.swing.ButtonGroup buttonGroupProxyTray
          +
        • +
        • +

          jButtonClearFavs

          +
          javax.swing.JButton jButtonClearFavs
          +
        • +
        • +

          jButtonExitNodeDetails

          +
          javax.swing.JButton jButtonExitNodeDetails
          +
        • +
        • +

          jButtonGuardNodeDetails

          +
          javax.swing.JButton jButtonGuardNodeDetails
          +
        • +
        • +

          jButtonMiddleNodeDetails

          +
          javax.swing.JButton jButtonMiddleNodeDetails
          +
        • +
        • +

          jButtonSetGuards

          +
          javax.swing.JButton jButtonSetGuards
          +
        • +
        • +

          jCheckProxyAll

          +
          javax.swing.JCheckBoxMenuItem jCheckProxyAll
          +
        • +
        • +

          jCheckProxyByPattern

          +
          javax.swing.JCheckBoxMenuItem jCheckProxyByPattern
          +
        • +
        • +

          jCheckProxyDisable

          +
          javax.swing.JCheckBoxMenuItem jCheckProxyDisable
          +
        • +
        • +

          jCheckTrayProxyAll

          +
          javax.swing.JCheckBoxMenuItem jCheckTrayProxyAll
          +
        • +
        • +

          jCheckTrayProxyByPattern

          +
          javax.swing.JCheckBoxMenuItem jCheckTrayProxyByPattern
          +
        • +
        • +

          jCheckTrayProxyDisable

          +
          javax.swing.JCheckBoxMenuItem jCheckTrayProxyDisable
          +
        • +
        • +

          jComboCountry

          +
          javax.swing.JComboBox<E> jComboCountry
          +
        • +
        • +

          jLabStatus

          +
          javax.swing.JLabel jLabStatus
          +
        • +
        • +

          jLabel10

          +
          javax.swing.JLabel jLabel10
          +
        • +
        • +

          jLabel12

          +
          javax.swing.JLabel jLabel12
          +
        • +
        • +

          jLabel4

          +
          javax.swing.JLabel jLabel4
          +
        • +
        • +

          jLabel5

          +
          javax.swing.JLabel jLabel5
          +
        • +
        • +

          jLabel6

          +
          javax.swing.JLabel jLabel6
          +
        • +
        • +

          jLabel8

          +
          javax.swing.JLabel jLabel8
          +
        • +
        • +

          jLabel9

          +
          javax.swing.JLabel jLabel9
          +
        • +
        • +

          jLabelCountry

          +
          javax.swing.JLabel jLabelCountry
          +
        • +
        • +

          jLabelExit

          +
          javax.swing.JLabel jLabelExit
          +
        • +
        • +

          jLabelExitBw

          +
          javax.swing.JLabel jLabelExitBw
          +
        • +
        • +

          jLabelExitCountry

          +
          javax.swing.JLabel jLabelExitCountry
          +
        • +
        • +

          jLabelExitIP

          +
          javax.swing.JLabel jLabelExitIP
          +
        • +
        • +

          jLabelExitNick

          +
          javax.swing.JLabel jLabelExitNick
          +
        • +
        • +

          jLabelExitStable

          +
          javax.swing.JLabel jLabelExitStable
          +
        • +
        • +

          jLabelGuard

          +
          javax.swing.JLabel jLabelGuard
          +
        • +
        • +

          jLabelGuardBw

          +
          javax.swing.JLabel jLabelGuardBw
          +
        • +
        • +

          jLabelGuardCountry

          +
          javax.swing.JLabel jLabelGuardCountry
          +
        • +
        • +

          jLabelGuardIP

          +
          javax.swing.JLabel jLabelGuardIP
          +
        • +
        • +

          jLabelGuardNick

          +
          javax.swing.JLabel jLabelGuardNick
          +
        • +
        • +

          jLabelGuardStable

          +
          javax.swing.JLabel jLabelGuardStable
          +
        • +
        • +

          jLabelMiddle

          +
          javax.swing.JLabel jLabelMiddle
          +
        • +
        • +

          jLabelMiddleBw

          +
          javax.swing.JLabel jLabelMiddleBw
          +
        • +
        • +

          jLabelMiddleCountry

          +
          javax.swing.JLabel jLabelMiddleCountry
          +
        • +
        • +

          jLabelMiddleIP

          +
          javax.swing.JLabel jLabelMiddleIP
          +
        • +
        • +

          jLabelMiddleNick

          +
          javax.swing.JLabel jLabelMiddleNick
          +
        • +
        • +

          jLabelMiddleStable

          +
          javax.swing.JLabel jLabelMiddleStable
          +
        • +
        • +

          jLabelStreams

          +
          javax.swing.JLabel jLabelStreams
          +
        • +
        • +

          jLabelTorLatency

          +
          javax.swing.JLabel jLabelTorLatency
          +
        • +
        • +

          jMenuBar

          +
          javax.swing.JMenuBar jMenuBar
          +
        • +
        • +

          jMenuHelp

          +
          javax.swing.JMenu jMenuHelp
          +
        • +
        • +

          jMenuItemAbout

          +
          javax.swing.JMenuItem jMenuItemAbout
          +
        • +
        • +

          jMenuItemAddPattern

          +
          javax.swing.JMenuItem jMenuItemAddPattern
          +
        • +
        • +

          jMenuItemDebugLog

          +
          javax.swing.JMenuItem jMenuItemDebugLog
          +
        • +
        • +

          jMenuItemExport

          +
          javax.swing.JMenuItem jMenuItemExport
          +
        • +
        • +

          jMenuItemGUI

          +
          javax.swing.JMenuItem jMenuItemGUI
          +
        • +
        • +

          jMenuItemGeoip

          +
          javax.swing.JMenuItem jMenuItemGeoip
          +
        • +
        • +

          jMenuItemHelp

          +
          javax.swing.JMenuItem jMenuItemHelp
          +
        • +
        • +

          jMenuItemImport

          +
          javax.swing.JMenuItem jMenuItemImport
          +
        • +
        • +

          jMenuItemLicense

          +
          javax.swing.JMenuItem jMenuItemLicense
          +
        • +
        • +

          jMenuItemPatternEdit

          +
          javax.swing.JMenuItem jMenuItemPatternEdit
          +
        • +
        • +

          jMenuItemPrefs

          +
          javax.swing.JMenuItem jMenuItemPrefs
          +
        • +
        • +

          jMenuItemQuit

          +
          javax.swing.JMenuItem jMenuItemQuit
          +
        • +
        • +

          jMenuItemQuitx

          +
          javax.swing.JMenuItem jMenuItemQuitx
          +
        • +
        • +

          jMenuItemStdout

          +
          javax.swing.JMenuItem jMenuItemStdout
          +
        • +
        • +

          jMenuItemTorCheck

          +
          javax.swing.JMenuItem jMenuItemTorCheck
          +
        • +
        • +

          jMenuItemTorMan

          +
          javax.swing.JMenuItem jMenuItemTorMan
          +
        • +
        • +

          jMenuMenu

          +
          javax.swing.JMenu jMenuMenu
          +
        • +
        • +

          jMenuNodeDetails

          +
          javax.swing.JMenuItem jMenuNodeDetails
          +
        • +
        • +

          jMenuProxy

          +
          javax.swing.JMenu jMenuProxy
          +
        • +
        • +

          jMenuTesting

          +
          javax.swing.JMenuItem jMenuTesting
          +
        • +
        • +

          jMenuWhois

          +
          javax.swing.JMenuItem jMenuWhois
          +
        • +
        • +

          jPanelMain

          +
          javax.swing.JPanel jPanelMain
          +
        • +
        • +

          jPanelNodeInfo

          +
          javax.swing.JPanel jPanelNodeInfo
          +
        • +
        • +

          jScrollPaneExitNodes

          +
          javax.swing.JScrollPane jScrollPaneExitNodes
          +
        • +
        • +

          jTableExitNodes

          +
          javax.swing.JTable jTableExitNodes
          +
        • +
        • +

          popupTable

          +
          javax.swing.JPopupMenu popupTable
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class client.TorMonFrame extends javax.swing.JFrame implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          jButtonClose

          +
          javax.swing.JButton jButtonClose
          +
        • +
        • +

          jPanel1

          +
          javax.swing.JPanel jPanel1
          +
        • +
        • +

          jPanel2

          +
          javax.swing.JPanel jPanel2
          +
        • +
        • +

          jPanelMain

          +
          javax.swing.JPanel jPanelMain
          +
        • +
        • +

          jScrollPane1

          +
          javax.swing.JScrollPane jScrollPane1
          +
        • +
        • +

          jScrollPaneStdOut

          +
          javax.swing.JScrollPane jScrollPaneStdOut
          +
        • +
        • +

          jTextAreaLaunch

          +
          javax.swing.JTextArea jTextAreaLaunch
          +
        • +
        • +

          jTextAreaStdOut

          +
          javax.swing.JTextArea jTextAreaStdOut
          +
        • +
        +
      • +
      +
    • +
    +
  • +
  • +

    Package lib

    +
      +
    • + + +

      Class lib.AboutDialog extends javax.swing.JDialog implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          strHome

          +
          java.lang.String strHome
          +
        • +
        • +

          strContact

          +
          java.lang.String strContact
          +
        • +
        • +

          jButtonClose

          +
          javax.swing.JButton jButtonClose
          +
        • +
        • +

          jButtonContact

          +
          javax.swing.JButton jButtonContact
          +
        • +
        • +

          jButtonVisit

          +
          javax.swing.JButton jButtonVisit
          +
        • +
        • +

          jLabelAppLogo

          +
          javax.swing.JLabel jLabelAppLogo
          +
        • +
        • +

          jPanel1

          +
          javax.swing.JPanel jPanel1
          +
        • +
        • +

          jTextAreaVersion

          +
          javax.swing.JTextArea jTextAreaVersion
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class lib.InfoDialog extends javax.swing.JDialog implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          fg

          +
          java.awt.Color fg
          +
        • +
        • +

          parent

          +
          java.awt.Frame parent
          +
        • +
        • +

          strButtClose

          +
          java.lang.String strButtClose
          +
        • +
        • +

          strTitle

          +
          java.lang.String strTitle
          +
        • +
        • +

          fontDefault

          +
          java.awt.Font fontDefault
          +
        • +
        • +

          tmrAutoClose

          +
          javax.swing.Timer tmrAutoClose
          +
        • +
        • +

          tmrButtonLock

          +
          javax.swing.Timer tmrButtonLock
          +
        • +
        • +

          jButtonCancel

          +
          javax.swing.JButton jButtonCancel
          +
        • +
        • +

          jButtonContinue

          +
          javax.swing.JButton jButtonContinue
          +
        • +
        • +

          jCheckBoxOption

          +
          javax.swing.JCheckBox jCheckBoxOption
          +
        • +
        • +

          jPanelMain

          +
          javax.swing.JPanel jPanelMain
          +
        • +
        • +

          jProgressBar

          +
          javax.swing.JProgressBar jProgressBar
          +
        • +
        • +

          jScrollPane2

          +
          javax.swing.JScrollPane jScrollPane2
          +
        • +
        • +

          jTextInfo

          +
          javax.swing.JTextArea jTextInfo
          +
        • +
        • +

          returnStatus

          +
          int returnStatus
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class lib.TextResourceDialog extends javax.swing.JDialog implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          strUrl

          +
          java.lang.String strUrl
          +
        • +
        • +

          jButtonClose

          +
          javax.swing.JButton jButtonClose
          +
        • +
        • +

          jButtonLaunchURL

          +
          javax.swing.JButton jButtonLaunchURL
          +
        • +
        • +

          jScrollPane1

          +
          javax.swing.JScrollPane jScrollPane1
          +
        • +
        • +

          jTextArea

          +
          javax.swing.JTextArea jTextArea
          +
        • +
        +
      • +
      +
    • +
    • + + +

      Class lib.TrayPopupMenu extends javax.swing.JPopupMenu implements Serializable

      +
        +
      • +

        Serialized Fields

        +
          +
        • +

          bg

          +
          java.awt.Color bg
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ +
+ + + + + + + +
+ + + + diff --git a/javadoc/stylesheet.css b/javadoc/stylesheet.css new file mode 100644 index 0000000..98055b2 --- /dev/null +++ b/javadoc/stylesheet.css @@ -0,0 +1,574 @@ +/* Javadoc style sheet */ +/* +Overall document style +*/ + +@import url('resources/fonts/dejavu.css'); + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a:hover, a:focus { + text-decoration:none; + color:#bb7a2a; +} +a:active { + text-decoration:none; + color:#4A6782; +} +a[name] { + color:#353833; +} +a[name]:hover { + text-decoration:none; + color:#353833; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} +/* +Document title and Copyright styles +*/ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* +Navigation bar styles +*/ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.subNavList li{ + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* +Page header and footer styles +*/ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexHeader { + margin:10px; + position:relative; +} +.indexHeader span{ + margin-right:15px; +} +.indexHeader h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* +Heading styles +*/ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* +Page layout container styles +*/ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Sans Mono',monospace; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* +List styles +*/ +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* +Table styles +*/ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { + width:100%; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { + color:#FFFFFF; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; + +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, +td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colLast, th.colOne, .constantsSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + white-space:nowrap; + font-size:13px; +} +td.colLast, th.colLast { + font-size:13px; +} +td.colOne, th.colOne { + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.useSummary td.colFirst, .useSummary th.colFirst, +.overviewSummary td.colOne, .overviewSummary th.colOne, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colOne, .memberSummary th.colOne, +.typeSummary td.colFirst{ + width:25%; + vertical-align:top; +} +td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor { + background-color:#FFFFFF; +} +.rowColor { + background-color:#EEEEEF; +} +/* +Content styles +*/ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} + +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} + +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} + +td.colLast div { + padding-top:0px; +} + + +td.colLast a { + padding-bottom:3px; +} +/* +Formatting effect styles +*/ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, +.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, +.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} + +div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} + +div.contentContainer ul.blockList li.blockList h2{ + padding-bottom:0px; +} diff --git a/packaging/DEBIAN/control b/packaging/DEBIAN/control new file mode 100644 index 0000000..91c1f47 --- /dev/null +++ b/packaging/DEBIAN/control @@ -0,0 +1,19 @@ +Source: selektor +Section: web +Priority: optional +Version: 3.13.73 +Installed-Size: 416 +Maintainer: Alistair Neil +Homepage: http://www.dazzleships.net +Package: selektor +Architecture: all +Depends: default-jre, + libnotify-bin, + libglib2.0-bin, + tor, + tor-geoipdb +Description: Tor exit node selector and traffic router + SelekTOR is a GUI frontend for the network Tor client. Used for security and + anonymization purposes or to bypass some firewall. Simplifies the process of + selecting Tor exit nodes and manages selective URL pattern based on routing + via system proxying. diff --git a/packaging/DEBIAN/postinst b/packaging/DEBIAN/postinst new file mode 100755 index 0000000..0e08757 --- /dev/null +++ b/packaging/DEBIAN/postinst @@ -0,0 +1,10 @@ +#!/bin/sh -e +# Move autostart +set -e +mv /usr/share/applications/selektor-autostart.desktop /etc/xdg/autostart -f + +# Automatically added by dh_icons +if which update-icon-caches >/dev/null 2>&1 ; then + update-icon-caches /usr/share/icons/selektor.png +fi +# End automatically added section diff --git a/packaging/DEBIAN/postrm b/packaging/DEBIAN/postrm new file mode 100755 index 0000000..b5f04f1 --- /dev/null +++ b/packaging/DEBIAN/postrm @@ -0,0 +1,10 @@ +#!/bin/sh -e +# Remove autostart +set -e +rm /etc/xdg/autostart/selektor-autostart.desktop -f + +# Automatically added by dh_icons +if which update-icon-caches >/dev/null 2>&1 ; then + update-icon-caches /usr/share/icons/selektor.png +fi +# End automatically added section diff --git a/packaging/applications/selektor-autostart.desktop b/packaging/applications/selektor-autostart.desktop new file mode 100644 index 0000000..23ec4c2 --- /dev/null +++ b/packaging/applications/selektor-autostart.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Categories=Application; +Name=SelekTOR +Comment=Tor Exit Node Selection and Proxying +Exec=/usr/bin/selektor --cleanup --start-delay 5 +Icon=/usr/share/icons/selektor.png +StartupNotify=false +Terminal=false +Type=Application +Keywords=network;tor diff --git a/packaging/applications/selektor-proxy-reset.desktop b/packaging/applications/selektor-proxy-reset.desktop new file mode 100644 index 0000000..7862897 --- /dev/null +++ b/packaging/applications/selektor-proxy-reset.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Version=1.0 +Categories=Network;Application; +Name=SelekTOR Proxy Reset +Name[fr]=Réinit. du mandataire SelekTOR +GenericName=SelekTOR Proxy Reset +GenericName[fr]=Réinit. du mandataire SelekTOR +Comment=SelekTOR System Proxy Reset +Comment[fr]=Réinitialisation du mandataire SelekTOR +Exec=/usr/bin/selektor --default-proxy +Icon=/usr/share/icons/selektor.png +Terminal=false +Type=Application +Keywords=network;tor diff --git a/packaging/applications/selektor.desktop b/packaging/applications/selektor.desktop new file mode 100644 index 0000000..91ece59 --- /dev/null +++ b/packaging/applications/selektor.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Categories=Network;Application; +Name=SelekTOR +Comment=Tor Exit Node Selection and Proxying +Exec=/usr/bin/selektor +Icon=/usr/share/icons/selektor.png +Terminal=false +Type=Application +Keywords=network;tor diff --git a/packaging/doc/changelog b/packaging/doc/changelog new file mode 100644 index 0000000..ce7ce40 --- /dev/null +++ b/packaging/doc/changelog @@ -0,0 +1,1033 @@ +selektor (3.13.73) stable; urgency=low + + * Removed Patreon support. + - Improved responsiveness of menu selection and opening of dialogs, not a + real problem on Linux but Win 10 was awful for some reason. + - Fixed bug in patterns export if a pattern storage file exceeded 2k in size + it would be corrupted inside zip file, likelyhood of happening though was + incredibly slim due to the very small size of pattern files, I only + noticed it when I reused the code in another app that had much larger files + to compress. + This is the final Linux release. + + -- Alistair Neil Fri,25 May 2018 11:45:00 -0400 + +selektor (3.13.72) stable; urgency=low + + * Removed WARN_UNSAFE option as it is about to be deprecated in the tor client + and it is now considered to be unsafe to unset it. + - Removed setListenAddress as it is also soon to be deprecated in the tor + client, connection sockets are now hardcoded to localhost 127.0.0.1 + - Modified the debian package control file based on some changes made by + the debian downstream packager as he is way better at it than me :) + + -- Alistair Neil Thu,16 Feb 2017 18:47:00 -0400 + +selektor (3.13.71) stable; urgency=low + + * Removed auto selection mode, retained all functionality using just the + favourites mode + - Removed dbl clicking node selection and activate node functionality from + exit table, all node activation handled by favourite selection + - Changed No Proxy to Disabled, SelekTOR will no longer exert any control + over the system proxy in this mode and it will be returned to its initial + state prior to SelekTOR starting up, users will be required to manually + configure their browser proxy settings in this mode. + - Moved GEOIP update file outside of Cloudflare's influence to make + its download more reliable, no more download fail due to captcha. + - Moved the online version tracking file outside Cloudflare's influence to + make update available checking more reliable no more version check + fail due to captcha. + - Updated copyright dates to reflect new year in all files + - Updated language and help files + - Added credits window, accessible from Help > Credits + - The online help files are now deprecated, Help Contents now opens the + locally supplied help files in the default browser, this again is to + avoid Cloudflares influence + - Made the UI slightly wider for 2 reasons, first to fit the Support button + and second folks are creating some tor nodes with rather large names so + I have increased the size of the node name fields to accommodate this. + - Large number of gtk fixes for better themeing under gtk2 & 3 + - Added in some key accelerators to menus + - Fixes for KDE's own system proxying mechanism, this fixes Chrome and + Chromium functionality under KDE + - Disabled tray functionality on KDE5 as they went and broke legacy system + tray support for no good reason. + - Changed to xdg-open mechanism to handle opening of default docs on + Linux as java inbuilt support is broken on KDE. + - Remove link to ipleak.net as the site fails to load with the majority of + exitnodes. + - Fixed KDE5 Plasma desktop detection + - Fixed active pac not updating on a pattern change. + + -- Alistair Neil Mon,6 Feb 2017 15:39:00 -0400 + +selektor (3.13.70) stable; urgency=low + + * Added function to access cached processes to OSFunction class. + - Modified getVersion() function in TorProcess class to prevent possible + startup issue. + - Added some additional debug output at --debug-fine level to provide + information on current running processes. + + -- Alistair Neil Sun,16 Oct 2016 14:11:00 -0400 + +selektor (3.13.69) stable; urgency=low + + * Fixed neverending launch indicator on various linux docks, when SelekTOR + is configured for hide to tray. + - Modified how Tor client version is obtained and separated it from the + hash password generator code to workaround some Windows client issues. + - Implemented a new internal tor hash password generator instead of making + a process call to the tor client as its faster. + - Fixed bug preventing SelekTOR startup on Fedora 24 due to Tor version + detection issue. + - Fixed license dialog showing blank contents on Fedora 24. + + -- Alistair Neil Thu, 7 July 2016 16:40:00 -0400 + +selektor (3.13.68) stable; urgency=low + + * Fixed always starting on login as reported in Debian bug tracking #826616 + This was down to some changes I made to CLI parsing when I re-arranged + the startup code back in 3.13.66 which affected how the --update-disable + option was handled. + - Also fixed 2 other CLI command issues related to the startup code changes. + + -- Alistair Neil Thu, 9 June 2016 00:04:00 -0400 + +selektor (3.13.67) stable; urgency=low + + * Fixed issue with favourites not always being applied correctly due to the + test status of a node being unknown. + - Cleaned up a bunch of unused declarations left over from the Utilities + class after moving the code into GTKFixes class + - Added multiple window close actions to dialogs to ensure correct closing + action depending on if a dialog is closed using a button or from the + titlebar. + + -- Alistair Neil Mon, 30 May 2016 16:43:00 -0400 + +selektor (3.13.66) stable; urgency=low + + * Fixed issue when Autoselect is disabled the last manually set exit node + was being used regardless of country selected. + - Slightly re-arranged startup code to simplify initialisation. + - Fixed a possible proxy setting issue which didn't seem to cause any + problem in normal usage certainly no one reported it, but I found one + test case where it could feasibly be an issue, before doing a proxy + restore I had a check to see if the proxy setting URL pointed to a local + file and if it existed then i restored the settings otherwise I put the + settings back to their system defaults forgetting that the URL could + also point to an offsite http location so now I just restore the original + settings regardless. + + -- Alistair Neil Fri, 27 May 2016 15:18:00 -0400 + +selektor (3.13.65) stable; urgency=low + + * Removed guard node checking as its no longer required as I ensure that + a valid guard node is used at circuit creation time. + - Changed initial tor process startup time to compensate for + Tor 0.2.7.6 slightly slower initialisation, this seems to be strictly + a Windows only issue at the moment but I have decided to play it safe + and include the change for Linux as well. + - Fixed expired non-existent node from causing exception after nodelist + generation bringing SelekTOR to a halt. This was due to a node expiring + or becoming unavailable between cache updates and have also ensured + that if it has been manually selected and no longer exists then it + lets Tor decide which node to select + - Changing proxy mode no longer restarts testing cycle, this was a hangover + from when 2 hop circuits were supported + - Fixed some javadoc constructor descriptions + - Fixed some variable naming convention errors + - Moved all GTK relevant fixes into their own class, makes the Windows + porting easier + - Update GEOIP can now be cancelled + - Some minor UI adjustments + + -- Alistair Neil Wed, 25 May 2016 14:41:00 -0400 + +selektor (3.13.64) stable; urgency=low + + * Fixed regression caused by the test cycle fix in the last release, + my apologies for this screw up i'm getting to old for this. + - Fixed an incorrectly named method in TorController, codewise it did not + affect anything, im just OCD about these things. + - Fixed Atlas Details buttons not being disabled at startup when their is + no active nodes. + + -- Alistair Neil Fri, 6 May 2016 20:36:00 -0400 + +selektor (3.13.63) stable; urgency=low + + * Fixed rare occurrence of test cycle failing to complete. + - Fixed openjdk7 package dependency issue and changed it to default-jre + to cope with both jre7 and jre8 as the latest Ubuntu is now shipping + with Java 8. + - Fixed lintian timestamp warnings in debian install package. + + -- Alistair Neil Tue, 3 May 2016 12:22:00 -0400 + +selektor (3.13.62) stable; urgency=low + + * Changed the default of "Download via Tor" to enabled. + As reported in Debian bug tracking #822830 + + -- Alistair Neil Thu, 28 Apr 2016 15:36:00 -0400 + +selektor (3.13.61) stable; urgency=low + + * Add a startup CLI option --update-disable which disables the update + version check phone home at startup, and also removes the checkbox + option from preferences. + - Updated man file. + + -- Alistair Neil Mon, 4 Apr 2016 14:40:00 -0400 + +selektor (3.13.60) stable; urgency=low + + * Fix for unrecognized node (ie. not in cached descriptors) not having their + type and stability correctly set, only really affected bridge nodes as + they are not held in the descriptors file and did not affect the operation + of SelekTOR other than incorrectly reporting the node as not stable. + - Some tiny optimisations to nodelist generation, slightly better string + handling and parsing. + - Fixed error in last release changelog entry date which lintian + complained about. + - Fixed latency threshold not being reset prior to test cycle after a + bridge change. + + -- Alistair Neil Sun, 13 Mar 2016 14:48:00 -0400 + +selektor (3.13.59) stable; urgency=low + + * Fix for issue of poor node selection at startup, if Tor chose a bad node + it would not get corrected until after the SelekTOR finished its + first test cycle. + - On startup SelekTOR now randomly selects a node from a countries listed + nodes and also takes any favourites into consideration + - Fixed rare nullpointerexception on quitting due to SwingTrayIcon tooltip + being updated after being destroyed on exit. + - More improvements to application update check + - Changed the initial startup countries to {PL} and {FI} as after a good + deal of testing these countries provided the most reliable nodes and + which do not block dazzleships.net to do the version check via. + + -- Alistair Neil Fri, 04 Mar 2016 18:01:00 -0400 + +selektor (3.13.58) stable; urgency=low + + * Small change in how the active circuit is determined due to a difference + in circuit building behaviour between the tor 2.5 client and the 2.6.10 + client. + This change ensures the same results on either client. + - Modified circuit testing routine to improve its speed of testing. + - Removed some exitexcludes functionality from TorController class as it + was no longer of use and had forgot to remove it on the last release. + + -- Alistair Neil Mon, 29 Feb 2016 19:37:00 -0400 + +selektor (3.13.57) stable; urgency=low + + * Many improvements to circuit activation and maintaining the chosen circuit + to overcome as much as possible Tor's natural inclination to create new + circuits in place of the chosen circuit. This is tricky to do especially + when I do my best to stick to the Tor' clients default settings wherever + possible, please note it is not completely foolproof as Tor makes it own + decisions based on its network conditions and on the rare occasion when + Tor does decide that reaching a given node with a given circuit is not + possible and switches to another then the Active Circuit info will now + accurately reflect that. + - Re-wrote internet access detection as I was not happy with it's + reliability again its tricky to do since I can't effectively ping an + external website in the clear in order to prevent DNS leakage. + - Moved some of Tor initial configuration settings out of the TorProcess + class into the main SelekTOR class where they really should be in order + to make the TorProcess class generic. + - Two hop mode is now no longer possible to do reliably due to the + difficulty in maintaining custom circuits so it has been removed. + - Active circuit is now constantly in sync with the Tor client and updated + every 5 seconds. + - Manual node switching is now non-destructive and can be done without + affecting existing streams/browser connections. + Please node existing connections remain connected to the previous + selected node, only new connections after the node change will use + the new node. + - Implemented support in TorController and TorProcess for 2 additional + Tor events, for future use. + - Removed selektor-tray.png icon, it is now part of an internal resource + package. + - Modified SwingTrayIcon to accept images from a resource package + - Renamed selektor-app.png to selektor.png and updated all desktop links + to this file + - Presetting initial startup countries {CA},{NO},{NL},{DE} to improve the + chances of retrieving application update information/version via Tor at + startup these are overridden by the users selected country once SelekTOR + has fully started, The country identifiers can also be seen in the Tor + client monitor + - Fixed bug in a thankfully unused method in the OSFunction class. + - Updated help files. + + -- Alistair Neil Sun, 28 Feb 2016 15:41:00 -0400 + +selektor (3.13.56) stable; urgency=low + + * Moved over some external links to Dazzleships to their new SSL + equivalents + - Fixed a screwup on the external links that caused the Tor Manual page to + go to the wrong URL + - Fixed an issue in the patterns editor that was causing problems with the + Windows version of the code. + - Set up proper handling of index out of bound errors so that they never + occur on the exitnode and guardnode tables instead of just lazily + catching them with an exception. + + -- Alistair Neil Tue, 2 Feb 2016 21:07:00 -0400 + +selektor (3.13.55) stable; urgency=low + + * Fixed an issue where by the active exit would sometimes report the wrong + information at startup due to being overwritten by the test cycle (my bad) + Should of used a copy/clone of my active exit nodeitem, which im doing now. + - Fixed an issue where the Tor client would try to change to a new + circuit for a variety of reasons number one reason being an unreachable + website, causing SelekTOR to be out of synch with the Tor client and thus + again report the incorrect active node information. + Since their is no way to prevent Tor from taking this action, SelekTOR + will change it back to the correct circuit immediately. + If this circuit is un-reachable on the next test cycle then it wont be + used. + - Changed when the version update check is done during the startup + sequence for a little bit more reliability since it is done via the + Tor network. + - Disabled auto selection if their is only one good node available. + - Some minor preparation work on external page links for my website + switchover to SSL, will fully implement on the next release. + + -- Alistair Neil Mon, 1 Feb 2016 19:41:00 -0400 + +selektor (3.13.54) stable; urgency=low + + * Fixed typo in --help output. + - New man page, thanks to Paulo Roberto Alves de Oliveira (aka kretcheu) + for that and the txt2man generation scripting. + - Updated copyright date for the new year in all source files and the About + dialog. + + -- Alistair Neil Sun, 17 Jan 2016 12:55:00 -0400 + +selektor (3.13.53) stable; urgency=low + + * Fixed some minor compile issues that generated warnings, code now compiles + cleanly. + Normally the warnings could be safely ignored but I decided to get OCD + on it. + + -- Alistair Neil Thu, 10 Dec 2015 08:55:00 -0400 + +selektor (3.13.52) stable; urgency=low + + * Fixed a localisation issue. + - Added Portuguese (Brazil) language support, thank you kretcheu + - Added some French language missing text. + - Added option to download geoip update via Tor (Experimental) + - Fixed issue whereby geoip check time was not updated if you opted to + cancel, causing it to repeatedly ask to do the update everytime SelekTOR + started up. + - Changed Update GEOIP to only be available if their is an active exit node + to accommodate the download via tor option. + - Fixed rare occasion when Geoip update would cause nodelist generation + failure which in turn meant SelekTOR would issue the nodelist failure + dialog and then shutdown. + + -- Alistair Neil Wed, 09 Dec 2015 12:07:00 -0400 + +selektor (3.13.51) stable; urgency=low + + * Fixed small issue with when the next geoip check date is saved, so that the + date of the next check is changed everytime the geoip is updated. + - Renamed the packages to be more in line with Debian packaging guidelines. + - Removed Encoding line from desktop entries and included Keywords line. + - Simplified build-jar script in the source tarball. + - Improved Debian control files. + - Javadocs now included in source tarball. + + -- Alistair Neil Wed, 02 Dec 2015 16:37:00 -0400 + +selektor (3.13.50) stable; urgency=low + + * Modified how SelekTOR handles a failed circuit activation, it's a little + more graceful. + It now first re-requests the failed node and if it fails again it then + requests the next best node (if there is one) and if that fails it then lets + the tor client choose. + This is a better fit now that we have the favourites mode. + - Fixed an issue in the calcBestNodes not properly storing all the + best nodes and dropping a node if it had the same latency as a previous + node. + - Fixed system tray popup menu issue on Cinnamon desktop if the panel is set + to Intelligent hide mode, its a bit of a hack but should be fine for + the majority of desktop configurations. Please note this is not + actually a Cinnamon issue but stems from a long time Java on Linux issue + and is related to why the tray icon does not properly resize with the + tray panel. + - Changes made to versioning to be compatible with Debian naming rules + - Removed my own geoip files to comply with Debian packaging, it now + uses the tor-geoipdb shipped with the distro + - Added dependency check to ensure tor-geoipdb is installed + - Remote http file retrieval can now handle binary files. + - Added sha1 checksum verification routine + - Added ability to download up to date geolocation data files. + + -- Alistair Neil Fri, 27 Nov 2015 18:42:00 -0400 + +selektor (3.13.49) stable; urgency=low + + * Fixed issue with http page retrieval which is used for retrieving the + latest application version. + - Fixed issue with application of favourites. + + -- Alistair Neil Thu, 29 Oct 2015 10:35:00 -0400 + +selektor (3.13.48) stable; urgency=low + + * Fixed index out of bounds error when it tried to autoselect best node + prior to first testing cycle. + - Modified ClientProcess to be slightly less cpu hungry when starting the + Tor client + + -- Alistair Neil Thu, 22 Oct 2015 16:08:00 -0400 + +selektor (3.13.47) stable; urgency=low + + * Fixed regression causing false "No circuits available" indications during + testing cycle. + - Fixed divide by zero error in best nodes calculation + - Increased circuit build timeout to 20 secs. + - Improved circuit activation and testing. + - Added "All routers down" status indication for tested nodes + - Removed some old no longer used stuff from pacfactory class, related to + the old default patterns. + - Updated geoip + + -- Alistair Neil Fri, 16 Oct 2015 14:01:00 -0400 + +selektor (3.13.46) stable; urgency=low + + * Changes to favourites in Favourites mode will be re-applied after 5 seconds + - Fixes and improvements to auto-node selection + - Optimised for Tor 2.6.10 but backward compatible to 2.4.x + - Various UI adjustments + + -- Alistair Neil Mon, 12 Oct 2015 15:09:00 -0400 + +selektor (3.13.45) stable; urgency=low + + * Implemented a favourites mode + - Removed manual node blacklisting as something similar can be implemented + using the new favourites system. + - Enhanced Tor process monitoring during startup phase + - Updated GEOIP + - Updated French language files for new favourites feature + - Updated Help files. + + -- Alistair Neil Thu, 8 Oct 2015 19:27:00 -0400 + +selektor (3.13.44.2) beta; urgency=low + + * Implemented a favourites mode (instead of a bandwidth mode) + - Removed manual node blacklisting as something similar can be implemented + using the new favourites system. + - Enhanced Tor process monitoring during startup phase + - Updated GEOIP + + -- Alistair Neil Fri, 25 Sep 2015 15:46:00 -0400 + +selektor (3.13.44.1) beta; urgency=low + + * Preparation work for implementing auto node select based on bandwidth + + -- Alistair Neil Mon, 21 Sep 2015 16:27:00 -0400 + +selektor (3.13.44) stable; urgency=low + + * Modified initial timeout on Tor client start. + - Improved startup which should work better on low speed connections tested + down to 256 kbps connections. + - Modified handling of No Circuits Available during testing + - Modified clientprocess loop monitoring + - Minor UI changes to improve efficency of GTK UI element resizing. + - Changed wait period for bridge node acquisition to 20 secs + - Updated GEOIP + + -- Alistair Neil Sat, 19 Sep 2015 10:02:00 -0400 + +selektor (3.13.43.2) beta; urgency=low + + * Improved startup which should work better on low speed connections tested + down to 256 kbps connections. + - Reverted internet access detection code to that used in 43 + - Modified handling of No Circuits Available during testing + + -- Alistair Neil Fri, 18 Sep 2015 14:43:00 -0400 + +selektor (3.13.43.1) beta; urgency=low + + * Slightly increased time alloted to wait for bridges to be generated. + - Minor UI changes to improve efficency of GTK UI element resizing. + - Trying out modified internet access detection yet again. + + -- Alistair Neil Fri, 18 Sep 2015 12:18:00 -0400 + +selektor (3.13.43) stable; urgency=low + + * Removed firefox/mozilla warning, now mostly redundant. + - Removed code to force setting of Socks remote dns on mozilla browsers as + remote dns is the default for Socks5 now. + - Reverted internet access check to the version used in 3.13.38 + - Changed traffic/read timeout period to 2 minutes + - Fixed proxy errors due to tor connections being accidentally closed by + SelekTOR under high latency and heavy loads. + - Added new CLI option --clear-cache which clears Tor cache on startup + - Fixed intermittent tor startup issue + + -- Alistair Neil Tue, 15 Sep 2015 15:07:00 -0400 + +selektor (3.13.42.2) beta; urgency=low + + * Removed firefox/mozilla warning, now mostly redundant. + - Removed code to force setting of Socks remote dns on mozilla browsers as + remote dns is the default for Socks5 now. + + -- Alistair Neil Mon, 14 Sep 2015 20:00:00 -0400 + +selektor (3.13.42.1) beta; urgency=low + + * Reverted internet access check to the version used in 3.13.38 + - Changed traffic/read timeout period to 2 minutes + + -- Alistair Neil Mon, 14 Sep 2015 14:14:00 -0400 + +selektor (3.13.42) stable; urgency=low + + * Fixed an issue introduced in 3.13.39 causing proxy error messages due to + node switching under high latency conditions particularly bad on low + bandwidth exit nodes. + It should not have been switching when their were active browser + connections. + + -- Alistair Neil Sun, 13 Sep 2015 15:56:00 -0400 + +selektor (3.13.41) stable; urgency=low + + * Modified internet detection to prevent unnecessary restarting of Tor Client. + - Removed StrictNodes option on test clients, as it is now unnecessary + and can hamper circuit building. + - Modified auto node select to immediately switch nodes if latency exceeds + timeout ie is unknown. + + -- Alistair Neil Wed, 9 Sep 2015 21:16:00 -0400 + +selektor (3.13.40) stable; urgency=low + + * Removed recommended nodes facility as this is now virtually redundant. + - Fixed possible null exception issue to do with bridges although the + exception in this case would not occur due to the variable being + initialised externally, it is now initialised correctly locally within + TorProcess class. + - Fixed some minor UI alignment issues + - Update check is no longer done hourly just at startup. + - Updated help files + + -- Alistair Neil Thu, 3 Sep 2015 19:16:00 -0400 + +selektor (3.13.39) stable; urgency=low + + * Fixed issue with incorrect node information sometimes being displayed + at startup as Tor generates 2 node circuits at startup and sometimes the + info for the wrong circuit would be displayed, I now ensure only one + circuit is used at startup. + - Added the facility to specify hosts, ips not to be proxied in the + pattern editor, note it does not support ip ranges you need to specify + a list of comma separated ips or hosts. + - Modified testing so that if no circuits are available it will close + all circuits and signal HUP to the tor test client before testing the + next node as sometimes it can cause the next node test to fail. + So far I have been unable to determine the reason for Tor sometimes + ceasing to build circuits and no errors appear to be generated by Tor + itself for me to act on. + It may be related to this issue + https://trac.torproject.org/projects/tor/ticket/11301 + - Reduced the period for which the Tor cache is considered fresh for 3 hrs + to 2 hrs. + - Added link to DNS leak test to the Help menu. + - Added removeMozillaUserPref to BrowserFactory for future use + - Added resetGnome3Pref to OSFunction + - Removed some unused methods + - Tor exit node now needs to be capable of both http & https, instead of + just one of them before it is accepted for inclusion in the node list. + - Help contents and Tor Manual links now point to their official + external web links. + - Updated English and French help files. + - Various French translation fixes. + - Updated geoip files + + -- Alistair Neil Sun, 23 Aug 2015 15:03:00 -0400 + +selektor (3.13.38) stable; urgency=low + + * Fixed startup failure issue related to invalid bridge entry. + - Added bridge entry validation. + - Added Bridge node indication on Active Circuit info panel + - Fixed invalid Internet unavailable message when bridge node is used + - Fixed issue with manual node selection being slow due to incorrect + circuit information being used + - Fixed French localisation issue preventing selektor from generating nodes + due to incorrect formating of bandwidth values + + -- Alistair Neil Fri, 24 Jul 2015 12:54:00 -0400 + +selektor (3.13.37) stable; urgency=low + + * Fixed GTK font color theming issues related to mostly poorly implemented + dark themes. + - Updated default recommended GB exit nodes whitelist + - Updated Geoip database files + + -- Alistair Neil Sun, 05 Jul 2015 15:20:00 -0400 + +selektor (3.13.36) stable; urgency=low + + * Fixed focus issue preventing correct operation of Hide/Show GUI + in traypopup + - Fixed minimise/restore/focus issues on various desktops + - Added compositor detection to compensate for issues caused by marco, + compiz and kwin. + - Tested against the following desktops Unity, Gnome, Mate, Lxde, XFCE, + KDE4, Cinnamon, E19 Enlightenment and Windows 7 + + -- Alistair Neil Wed, 03 Jun 2015 14:12:00 -0400 + +selektor (3.13.35) stable; urgency=low + + * Small modification to how GUI visibility toggling is handled from the + tray icon when GUI is visible but does not have focus + - Remove unused class reference from BrowserFactory + - Fixed issue with selected guard nodes sometimes not being properly + applied whilst in manual selection mode causeing the check guard dialog + to popup. + - Adjusted ClientProcess readline timing, making it less cpu hungry + - Bandwidth changed to advertised bandwidth in MB\s to match up with + Atlas details + + -- Alistair Neil Thu, 28 May 2015 19:10:00 -0400 + +selektor (3.13.34) stable; urgency=low + + * Renamed getLatestAppVersion to getURLAsString in NetFunctions + - Modified how app version checking is handled, to improve reliability + - Lowered some of the socket timeouts on remote data fetches. + - Made some changes to accommodate changes to the Windows release in + regards to the Windows release adopting the same versioning scheme as + the Linux release + + -- Alistair Neil Mon, 25 May 2015 14:20:00 -0400 + +selektor (3.13.33) stable; urgency=low + + * Restored system tray functionality on Cinnamon as the issue has been + fixed on Cinnamon desktop 2.6. + - Fix for Firefox browser check that would cause SelekTOR to hang directly + after generating nodelist + + -- Alistair Neil Sat, 23 May 2015 15:47:00 -0400 + +selektor (3.13.32) stable; urgency=low + + * Disabled tray functionality on Gnome3, since Java traycion support + on that desktop is incomplete. + - Some fixes to ensure proper closure of information dialogs. + - Some fixes for multiple instance detection. + + -- Alistair Neil Wed, 20 May 2015 14:50:00 -0400 + +selektor (3.13.31) stable; urgency=low + + * Fixed an issue where a hidden dialog on the trayicon would sometimes be + visible under the compiz compositor, its opacity is now set to zero to + make it truly invisible. + - SwingTrayIcon is now a wrapper around tray icon instead of a class + extension + - Fixes for trayicon tooltip issues where if border space was not + reserved by the notification tray dock panel then tooltip failed to + display properly. + - Added new preferences option "Hide instead of Minimise" for greater + flexibility with the multitude of different dock/launcher mechanisms on + Linux + - Fixed tray icon being removed when a compositor such as compiz, + compton etc is toggled on/off it now gets automatically reloaded. + - Modified application icon to be a better fit in the dock by adding + a transparent border, so that modern dock dot markers show up better. + - System tray functionality is disabled on Cinnamon desktop due to + issues that desktop has with Java's native trayicon. + - Added linux desktop detection, to detect when Cinnamon desktop + is active in order to disable tray functionality on this desktop + - Set a minimum size on the Tor Monitor window. + + -- Alistair Neil Fri, 8 May 2015 23:24:00 -0400 + +selektor (3.13.30) stable; urgency=low + + * TorController.getTrafficFailCount now returns -1 if Tor fails to respond, + this fixes a false Internet access un-available notification being raised + when net access is restored. + - Hopefully fixed all internet access restoration issues, its a tricky one + as tor appears to behave differently under windows compared to linux. + - Added new debug feature in that you can now specify a debug output file + with all the various debug options. + - Some more improvements to SwingTrayIcon tooltip + - Updated geoip + + -- Alistair Neil Thu, 30 Apr 2015 19:34:00 -0400 + +selektor (3.13.29) stable; urgency=low + + * Fixed tray tooltip sometimes not being hidden. + - Modified net access detection to prevent a rare failure to restart Tor + on net access restoration. + - Fixed pattern changes not being immediately applied on save in pattern + editor + + -- Alistair Neil Sun, 26 Apr 2015 18:02:00 -0400 + +selektor (3.13.28) stable; urgency=low + + * Added check and warning for not enough active guard nodes. + - Renamed java package lang to resources. + - Added default recommended exitnodes list as a fallback incase for any + reason SelekTOR is unable to connect to Dazzleships to download the + remotely stored recommended list. + This means SelekTOR now has full functionality even without access to + Dazzleships. + - Minor adjustments to column widths on exitnode table + - Modified how mouse location on Swingtray is handled. + - Improved secure delete, zero wiped files and folders are now renamed + prior to deletion, sequence is now zerowipe,zerolength,rename,delete. + - Modified NetFunctions saveURLToFile to override age check if required. + - Added more debug output to NetFunctions.saveURLToFile + - Improved detection of Tor client startup failure + + -- Alistair Neil Sun, 12 Apr 2015 15:51:00 -0400 + +selektor (3.13.27) stable; urgency=low + + * Fixed possible but extremely rare shutdown issue due to an exception + which may occur when building a circuit and a Quit is requested. + - More improvements to tray icon tooltip placement. + - Fixed changelog dates. + + -- Alistair Neil Fri, 10 Apr 2015 13:59:00 -0400 + +selektor (3.13.26) stable; urgency=low + + * Minor tweaks to trayicon, just some polish. + - Moved Tor cache to the user settings area on Linux you can find it at + ~/.SelekTOR/3xx/cache instead of tmp as I forgot on some/most + linux systems tmp gets cleared at startup. + - Fixed not honouring manual node selection on proxy mode change + + -- Alistair Neil Thu, 9 Apr 2015 13:12:00 -0400 + +selektor (3.13.25) stable; urgency=low + + * Desktop notifications now handled by its own class instead of + SwingTrayIcon + - New class which acts as a simplification wrapper around SwingTrayIcon + called TrayUtility + - Extensive code audit to ensure all resources that could stop the JVM from + properly exiting are closed and disposed of in a controlled manner. + This should in future ensure clean shutdowns of SelekTOR + Also added more comments as part of audit. + - Updated geoip files. + + -- Alistair Neil Fri, 27 Mar 2015 19:42:00 -0400 + +selektor (3.13.24) stable; urgency=low + + * Partial re-write of clientprocess to fix startup issues as the fixes I + introduced in 3.13.23 were not reliable especially if internet access + was lost. + + -- Alistair Neil Mon, 23 Mar 2015 15:26:00 -0400 + +selektor (3.13.23) stable; urgency=low + + * Update notification dialog is now set to auto close after 30 seconds + - Modification to SelekTOR to handle a stalled Tor client startup which + sometimes occurs at Bootstrapped 5% Connecting to directory server. + If this notification is received 3 times the SelekTOR initiates a + restart of the Tor client. + - Improved test client startup times, by fixing a bug where they should + of been using previously cached descriptors instead of + re-downloading microdescriptors. + + -- Alistair Neil Sat, 21 Mar 2015 16:59:00 -0400 + +selektor (3.13.22) stable; urgency=low + + * More fixes for swingtray, practically a rewrite to address issues + when run on the Cinnamon desktop. + - Fixed some object alignment issues on Guardnode and Pattern editor + dialogs. + + -- Alistair Neil Sun, 08 Mar 2015 21:24:00 -0400 + +selektor (3.13.21) stable; urgency=low + + * Fixed issues with swingtray tooltip + + -- Alistair Neil Sat, 07 Mar 2015 19:03:00 -0400 + +selektor (3.13.20) stable; urgency=low + + * Fixed bandwidth sort. + - Reduced number of tor threads to 3 instead of 6 which reduces memory + consumption by about 45% approx 150MB over the previous version. + - Speeded up testing to compensate for less tor test threads. + - Unused tor test threads are now shutdown after every test cycle has + completed reducing memory usage further. + - Added bandwidth column to guard table for sorting by bandwidth. + - Added proxy mode checkboxes to buttongroups to fix selection issue + - Added closeActiveStreams() method to TorController + - Improved stale cache handling + + -- Alistair Neil Sat, 28 Feb 2015 23:34:00 -0400 + +selektor (3.13.19) stable; urgency=low + + * Fixed bug in TorController.getEntryGuardsAsCSV() which would cause an + exception and testing to hang if an unuseable entry node was returned. + + -- Alistair Neil Mon, 16 Feb 2015 15:55:00 -0400 + +selektor (3.13.17) stable; urgency=low + + * Removed the internal force node switch option when in proxy all traffic + mode to allow long lived tor connections such as when used by IRC. + - Fixed issue with not immediately selecting a new node after testing. + - Added desktop notification functionality + - Fixed Selektor quitting when used with a torrent client, although you + should not be torrenting via tor as a lot of nodes block bittorrent. + - Fixed menu selection foreground colour issues due to java gtk bugs. + - Fixed issue of loss of guard entries if a startup error was encountered + - Fixed issue of slow shutdown of tor clients on quit due to a + code regression fault. + - Merged FixGTK functions into Utilities class, for easier Windows porting + - Some object renaming and documentation. + + -- Alistair Neil Tue, 3 Feb 2015 14:07:00 -0400 + +selektor (3.13.16) stable; urgency=low + + * Now send the TOR QUIT command instead of relying completely on process + destroy. + - Update check is now done every 30 minutes as well as at startup. + - Small fix to traffic fail count method in TorController + + -- Alistair Neil Tue, 27 Jan 2015 20:37:00 -0400 + +selektor (3.13.15) stable; urgency=low + + * Major improvements to bridge handling + - Fixed testing cycle being re-triggered while testing. + - Greatly improved net detection and recovery from net failure + - Fixed issues with import patterns and zip extraction + + -- Alistair Neil Sat, 24 Jan 2015 18:42:00 -0400 + +selektor (3.13.14) stable; urgency=low + + * Some minor localisation fixes + - Changed the order of display of exitnode and guardnode info in tray + tooltip + - Restart tor client immediately in the event of no viable exits + - Small change to version routine in Utilities class to make porting to + Windows slightly easier + - Updated geoip files + - Modified how startup delay on autostart is handled. + - Tor monitor window now resizable + - Fixed bridges issue causing a hang + + -- Alistair Neil Fri, 23 Jan 2015 15:17:00 -0400 + +selektor (3.13.13) stable; urgency=low + + * Initial snapshot of experimental branch 3-13-13-beta to become stable branch + - Various fixes to SwingTray to fix positional issues when compiz is running + - Added --reset-defaults in order to reset to default safe settings from + the console. + - Prevented setting of listening port below 9054 + + -- Alistair Neil Sun, 18 Jan 2015 17:42:00 -0400 + +selektor (3.12.18) stable; urgency=low + + * Removed Unamed and Stable nodes only options as I now need all nodes to be + loaded, these should of been removed in 3.12.16 but I forgot. + I could implement a view filter for them but its more hassle than + its worth. + - Fixed an incorrect null response after an interrupt on the thread sleep + during client process startup. + - Added catch for not enough directory information message, which will + force a cache refresh on restart. + - Added tor cache age check every time a tor client is started + - Improved debugging log statements, and added more startup debug options + - Removed unused constant from TorController + - Updated language files and help files. + + -- Alistair Neil Wed, 03 Dec 2014 14:00:00 -0400 + +selektor (3.12.17) stable; urgency=low + + * Fixed testing cycle stalling, a regression on my part (stupid me) + + -- Alistair Neil Fri, 28 Nov 2014 01:05:00 -0400 + +selektor (3.12.16) stable; urgency=low + + * Re-worked Nodelist generation + - Fixed some node being rejected due to having different fingerprints + but the same ip address. This combo is possible and valid so we cant + reject them as it can cause a Null exception being thrown during a node + lookup. + You should now see a lot more nodes in the nodelist. + + -- Alistair Neil Tue, 25 Nov 2014 14:22:00 -0400 + +selektor (3.12.15) stable; urgency=low + + * Modified start up sequence to fix intermittent problem with fetching + remote data from dazzleships caused by the initial tor chosen circuits + not always being capable of handling http on port 80. + Now i wait for nodelist generation to complete which filters out nodes + that cant handle port 80, once those nodes have been applied to tor + I wait for tor to generate new circuits using my filtered list then + fetch the remote data, this slightly increases initial startup time. + - Increased circuit build timeout to 15 secs per circuit. + - If a node has no exit routes then I abort testing immediately instead of + waiting for the timeout which slightly improves the speed of testing. + - Various other minor fixes. + + -- Alistair Neil Thu, 20 Nov 2014 15:58:00 -0400 + +selektor (3.12.14) stable; urgency=low + + * Lowered package version requirements for libglib2.0-bin 2.32+ + - This should fix the reported issue with Debian Wheezy. + + -- Alistair Neil Tue, 18 Nov 2014 12:41:00 -0400 + +selektor (3.12.13) stable; urgency=low + + * Fixed a regression which would cause test threads to fail with the + - No Circuits Available status message. + + -- Alistair Neil Mon, 17 Nov 2014 04:15:00 -0400 + +selektor (3.12.12) stable; urgency=low + + * Preparation work for merge from experimental branch + - Restructuring for possible incorporation of additional guard + node functionality. + - Some variable and class renaming. + - Redesigned ClientProcess class, gives improved startup time and + reduced CPU usage. + - Renamed blacklist and whitelist file. + - Reduced tor client restart delays to 2000ms + - Improved threading, and reduced usage of swingworkers. + - Implemented detection of "no exit routers" to a tor node. + - General efficiency improvements, reducing CPU usage. + - More debug options, run "selektor --help" to list them. + - Circuit building wait time slighty increased to 250ms + - Improved firefox browser check, warning only issued if browser + requires restart to apply new settings. + If settings are already applied then warning is not issued. + - Added filtering for port 443 + - Added own geoip6 support so tor-geoipdb is no longer required + - Updated geoip databases + - Fixed sometimes failing to on remotedata fetch. + + -- Alistair Neil Thu, 13 Nov 2014 15:15:00 -0400 + +selektor (3.12.11) stable; urgency=low + + * Moved language files into main jar. + - Enable predictive circuits on Tor startup. + - Renamed GlobalVariable to GlobalServices. + - Fixed hanging at Bootstrap Done 100% caused by app update check failure + due to the slower nature of Tor, added error detection to prevent the + hanging. + - Increased timeout on app aupdate and nodelist fetch due to the slower + nature of Tor, added error detection. + - Added method to set default socket timeout in NetFunctions. + - Circuit building wait time reduced to 100ms from 500ms making circuit + build detection a bit faster. + + -- Alistair Neil Wed, 5 Nov 2014 16:17:00 -0400 + +selektor (3.12.10) stable; urgency=low + + * Small tweak to net reachability detection to ensure no false detections. + - Fixed bug in version check routine. + + -- Alistair Neil Mon, 3 Nov 2014 20:00:00 -0400 + +selektor (3.12.9) stable; urgency=low + + * Local DNS leakproofing, SeleKTOR now works without any local DNS resolution. + - App update check and fetching of the recommended nodelist is done via Tor + including their DNS lookups. + - Removed net latency field so no more local DNS resolves or pinging + of Google are done directly via the net. + - Net unreachable detection is now done using Tor. + - Whois is now done in default browser. + - Updated help files. + + -- Alistair Neil Mon, 3 Nov 2014 13:48:00 -0400 + +selektor (3.12.8) stable; urgency=low + + * Fixed Bad Package error on Ubuntu + - Implemented Installed-Size in Debian control file. + - Added a dummy class to SelekTORLang, to prevent lintian + complaining about empty jar. + + -- Alistair Neil Fri, 31 Oct 2014 20:06:00 -0400 + +selektor (3.12.7) stable; urgency=low + + * Fixed a proxy reset issue. + - Modified proxy restore so that if it doesnt find a valid proxy backup + file then it will just reset the proxy to the system defaults. + - Fixed a debian packaging issue whereby the autostart link was not removed + on package uninstall. + - Fixed issues with tarball install/uninstall scripts + + -- Alistair Neil Thu, 30 Oct 2014 13:46:00 -0400 + +selektor (3.12.6) stable; urgency=low + + * Fixed main tor thread shutdown issue on quit. + - Fixed tor sometimes failing to restart, when listen port was changed. + + -- Alistair Neil Tue, 28 Oct 2014 20:08:00 -0400 + +selektor (3.12.5) stable; urgency=low + + * Switched build structure over to Debian style. + - Improved UI layout for better font and language scaling + - Added .deb package. + - See chlogoldstyle.gz for older changelog entries. + + -- Alistair Neil Sun, 26 Oct 2014 14:28:00 -0400 diff --git a/packaging/doc/copyright b/packaging/doc/copyright new file mode 100644 index 0000000..1e49552 --- /dev/null +++ b/packaging/doc/copyright @@ -0,0 +1,22 @@ +Copyright (C) 2009 - 2017 Alistair Neil + +This software was put together by Alistair Neil , from +the following sources available for download at the SelekTOR Homepage. + +SelekTOR Homepage : http://www.dazzleships.net/?page_id=71 + + +SelekTOR 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 2 of the License, or +(at your option) any later version. + +SelekTOR 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 SelekTOR. If not, see . +On Debian systems, the complete text of the GNU General Public License +can be found in `/usr/share/common-licenses/GPL-2'. diff --git a/packaging/doc/help-en.html b/packaging/doc/help-en.html new file mode 100644 index 0000000..9a1011a --- /dev/null +++ b/packaging/doc/help-en.html @@ -0,0 +1,233 @@ + + + + + SelekTOR Help + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

SelekTOR Main Window Interface Options

+

Active Country
+Select your desired exit +country here. SelekTOR will retrieve the available exit nodes for +this country if it has any.

+

Proxy Mode : Disabled
+Proxying +via SelekTOR/Tor is disabled, SelekTOR will no longer exert any +control over the system proxy settings.
+Manual configuration of +your web browser proxy settings will be required.

+

Proxy Mode : Proxy all traffic
+Enable this +mode to proxy all traffic through the active tor proxy node.
+Uses +3 hop circuits for best anonymity (Tor default)
+Not suitable for +streaming.

+

Proxy Mode : Proxy by pattern
+Enable this +mode to proxy selectively by URL pattern through the active tor proxy +node.
+Uses 2 hop circuits for best latency and sacrifices some +anonymity.

+

Set Guard Nodes
+
Opens the guard node +selection window.

+

Node Table Options (Right Click)

+

Node Details
+Brings node details of the +selected node in your default web browser, provided by Atlas.

+

Whois
+Provides whois information of the +selected node.

+

Begin Test Cycle
+Starts a round of node +testing.

+

Active Circuit Information

+

Nickname
+The assigned nickname for the node

+

IP
+The ip address of the node.

+

Country
+The country in which the node is +located.

+

BandWidth (MB/s)
+This indicator shows the +reported bandwidth of the active node.

+

Stable
+Whether the node has enough uptime to +be considered stable.

+

Latency (ms)
+This indicator shows the +latency to the test URL via the currently selected Tor exit node. The +latency provides an indication of the response time of the node in +milliseconds, where 1000ms = 1 second.

+

Streams
+This indicator shows the number of +active streams on the active node.

+

SelekTOR System Tray Interface Options +(Right Click System Tray Icon)

+

Proxy Mode : Disabled
+Proxying +via SelekTOR/Tor is disabled, SelekTOR will no longer exert any +control over the system proxy settings.
+Manual configuration of +your web browser proxy settings will be required.

+

Mode: Proxy All
+Enable this mode to proxy +all traffic through the active tor proxy node.
+Not suitable for +multimedia streaming.

+

Mode: Proxy by Pattern
+Enable this mode to +proxy selectively by URL pattern through the active tor proxy node.

+

Hide / Show GUI.
+Change GUI visibility.

+

Quit SelekTOR.
+Quit the application.

+

SelekTOR Basic Preferences Options

+

Hide To Tray on Startup
+
The GUI will be +hidden on start up, can be made visible again by double clicking the +SelekTOR icon in the system tray.

+

Autostart SelekTOR
+SelekTOR will autostart +at login.

+

Check for updates on startup.
+Will check if +any updates of SelekTOR are available from Dazzleships Dot Net.

+

Disable Tray Icon.
+Disables system tray +functionality.

+

Disable desktop notifications
+Turn of all +desktop notifications from SelekTOR.

+

Minimise at startup
+
Minimise SelekTOR to the +taskbar on startup.

+

Minimise instead of exit on close
+
Instead of +quitting SelekTOR minimise to the taskbar on clicking the main window +close control icon.

+

Hide instead of minimise
+
Instead of +minimising SelekTOR to the taskbar completely hide SelekTOR.

+

Secure delete Tor caches on exit
+Securely +wipes the Tor caches by renaming and overwriting with zero’s prior +to deletion.

+

SelekTOR Advanced Preferences Options

+

Tor Listening Port
+The main listening port +on which the Tor client will listen for incoming connections, usually +from whichever proxy server you are using. Port 9054 is the SelekTOR +default.

+

Tor Bridge Address
+If you need to bypass an +ISP block then enter a valid TOR bridge address in here.
+Use the +button “Get Bridges” to find valid TOR bridge addresses.

+

Safe Socks
+When enabled, Tor will reject +application connections that use unsafe variants of the socks +protocol — ones that only provide an IP address, meaning the +application is doing a DNS resolve first. Specifically, these are +socks4 and socks5 when not doing remote DNS.

+

Warn Unsafe
+When enabled, Tor will warn +whenever a request is received that only contains an IP address +instead of a hostname. Allowing applications to do DNS resolves +themselves is usually a bad idea and can leak your location to +attackers.

+

Test Socks
+When enabled, Tor will make a +notice-level log entry for each connection to the Socks port +indicating whether the request used a safe socks protocol or an +unsafe one (see above entry on SafeSocks). This helps to determine +whether an application using Tor is possibly leaking DNS requests.

+

Logging Level
+Set the Tor client logging +level, all output is to StdOut console to avoid disk writes.

+

Safe Logging
+When enabled, Tor will scrub +potentially sensitive strings from log messages (e.g. addresses) by +replacing them with the string [scrubbed]. This way logs can still be +useful, but they don’t leave behind personally identifying +information about what sites a user might have visited.

+

Avoid Disk Writes
+When enabled, Tor will try +to write to disk less frequently than we would otherwise. This is +useful when running on flash memory or other media that support only +a limited number of writes.

+

Startup Arguments
+This will pass any user +specified startup arguments to the Tor client, see Tor Manual for a +list of valid command line arguments.

+

Default HTTP Proxy
+You can specify a +downstream proxy server here, anything not routed through TOR will be +sent to the proxy server. Leaving it blank will mean anything not +routed through TOR will go directly to the net, this is the default.

+

TOR Client Monitor

+

Startup Arguments
+
This displays all the +arguments that are passed at startup to the Tor client.

+

StdOut Monitor
+
This displays the output from +the Tor clients Stdout logging stream in realtime.

+

SelekTOR Pattern Editing

+

Proxy Pattern Editor
+The pattern editor +allows you to modify, add, delete or disable URL patterns used to +redirect specific URL’s via the Tor socks proxy. Only use this if +you know what you are doing as any errors made here can cause +proxying to fail completely.

+

Quick Add Pattern
+Quick add pattern allows +you to quickly add a new pattern for the currently active country. An +example is given below:

+

Description: Newzbin
+Pattern: *newzbin.com*

+

Import Patterns
+Pattern files are stored in +a ZIP file. This zip file can be directly imported into SelekTOR +using this action.

+

Export Patterns
+This allows you to export +all your user created pattern files as a SelekTOR compatible zipped +import file.

+

Additional Information

+

This product includes GeoLite2 data created by MaxMind, available +from http://www.maxmind.com.

+ + \ No newline at end of file diff --git a/packaging/doc/help-fr.html b/packaging/doc/help-fr.html new file mode 100644 index 0000000..43b29d5 --- /dev/null +++ b/packaging/doc/help-fr.html @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Options de l’interface de la fenêtre +principale de SelekTOR

+

Pays actif
+Choisissez votre pays de sortie +désiré ici. SelekTOR récupérera les nœuds de sortie proposés +pour ce pays s’il en a.

+

Mode de relais: désactivé
+
Le +relais par SelekTOR/Tor est désactivé, SelekTOR ne contrôlera +plus
+les paramètres de mandataire du système.
+La +configuration manuelle des paramètres de serveur mandataire de
+votre +navigateur sera requise.
+

+

Mode de relais : relayer tout le trafic
+Activer +ce mode pour relayer tout le trafic par le nœud mandataire Tor +actif.
+Ce mode utilise des circuits à 3 sauts pour un meilleur +anonymat (valeur par défaut de Tor)
+Ne convient pas à la +diffusion en flux continu.

+

Mode de relais : relais par modèle
+Activer +ce mode pour relayer sélectivement par le nœud mandataire Tor actif +par modèle d’URL.
+Ce mode utilise des circuits à 2 sauts +pour un délai de transit réduit en sacrifiant un peu l’anonymat.

+

Définir les nœuds de garde
+
Ouvre la +fenêtre de sélection des nœuds de garde.

+

Options du tableau des nœuds (clic droit)

+

Activer le nœud
+Les nœuds peuvent être +activés manuellement en utilisant cette option. Vous devriez +désactiver le Choix automatique du nœud si vous désirez vous +assurer que l’activation reste permanente.

+

Détails du nœud
+Affiche les détails du +nœud choisi dans votre navigateur Web, fourni par Atlas.

+

Qui est
+Fourni les informations Qui est sur +le nœud choisi.

+

Commencer le cycle de test
+Lance un cycle de +test du nœud.

+

Informations sur le circuit actif

+

Pseudonyme
+Le pseudonyme assigné à ce +nœud.

+

IP
+L’adresse IP du nœud.

+

Pays
+Le pays où le nœud est situé.

+

Bande-passante (MB/s)
+Cet indicateur montre la bande-passante +rapportée pour le nœud actif.

+

Stable
+Cet indicateur montre si la période +de fonctionnement du nœud est assez longue pour qu’il soit +considéré stable.

+

Délai de transit (ms)
+Cet indicateur montre +le délai de transit vers l’URL de test par le nœud de sortie Tor +choisi. Le délai de transit fourni une indication du temps de +réponse du nœud en millisecondes, où 1 000 ms = 1 seconde.

+

Flux
+Cet indicateur montre le nombre de flux +actifs pour le nœud actif.

+

Options de l’interface de la zone de +notification de SelekTOR (clic droit sur l’icône de notification)

+

Mode : pas de relais
+Le relayage par Tor +peut être désactivé en choisissant cette option. Tout le trafic +système sortira vers Internet normalement.

+

Mode : relayer tout le trafic
+Activer ce +mode pour relayer tout le trafic par le nœud mandataire Tor +actif.
+Ne convient pas pour la diffusion en flux continu.

+

Mode : relayer par modèle
+Activer ce mode +pour relayer sélectivement par le nœud mandataire Tor actif par +modèle d’URL.

+

Cacher / montrer l’IUG
+Changer la +visibilité de l’IUG.

+

Quitter SelekTOR
+Quitter l’application.

+

Options des préférences de base de +SelekTOR

+

Cacher vers la zone de notification au démarrage
+L’IUG +sera cachée au démarrage et redeviendra visible en double cliquant +sur l’icône SelekTOR dans la zone de notification.

+

Démarrage automatique de SelekTOR
+SelekTOR +démarrera automatiquement à la connexion.

+

Vérifier les mises à jour au démarrage
+Il +sera vérifié si des mises à jour de SelekTOR sont proposées sur +Dazzleships point net.

+

Désactiver l’icône de notification
+Désactive +la fonction de zone de notification.

+

Minimiser au démarrage
+
Minimise SelekTOR +vers la barre des tâches au démarrage.

+

Minimiser au lieu de quitter lors de la fermeture
+
Au +lieu de quitter SelekTOR, minimiser vers la barre des tâches après +avoir cliqué sur l’icône de fermeture de la fenêtre principale.

+

Cacher au lieu de minimiser
+
Au lieu de +minimiser SelekTOR vers la barre des tâches, cacher complètement +SelekTOR.

+

Effacement sécurisé des caches de Tor lors de la +fermeture
+Supprime les caches de Tor de façon +sécurisée en renommant et en remplissant de zéros avant de +supprimer.

+

Afficher une fenêtre d’avertissement si un nœud de +garde non spécifié est utilisé
+
Ouvre une fenêtre +d’avertissement si vous avez choisi des nœuds de garde +manuellement et si un nœud de garde autre que ceux spécifiés est +utilisé. Cette condition ne se présente que si Tor ne peut se +connecter à aucun de vos nœuds de garde désignés, ce qui est +rare.
+Si cela se passe toutefois, vous devriez vérifier votre +choix de nœuds de garde.

+

Options avancées des préférences de +SelekTOR

+

Port d’écoute de Tor
+Le port d’écoute +principal sur lequel le client Tor écoutera les connexions +entrantes, habituellement de n’importe quel serveur mandataire que +vous utilisez. 9054 est le port par défaut de SelekTOR.

+

Adresse de pont de Tor
+S’il vous faut +contourner le blocage d’un FSI, saisissez alors ici une adresse de +pont de Tor valide.
+Utilisez le bouton « Obtenir des ponts » +pour trouver des adresses de ponts de Tor valides.

+

Socks sécuritaire
+Activée, Tor rejettera +les connexions logicielles qui utilisent des variantes dangereuses du +protocole Socks — celles qui fournissent seulement une adresse +IP, ce qui signifie que l’application fait d’abord une résolution +DNS. Spécifiquement, il s’agit de socks4 et socks5 s’il n’y a +pas de DNS distant.

+

Avertir si à risque
+Activée, Tor avertira +à chaque fois qu’une requête est reçue contenant seulement une +adresse IP au lieu d’un nom d’hôte. Permettre aux applications +de faire elles-mêmes des résolutions DNS est habituellement une +mauvaise idée et pourrait divulguer votre emplacement à des +attaquants.

+

Tester Socks
+Activée, Tor journalisera une +entrée de journal de niveau « avis » pour chaque connexion en +indiquant si elle utilise un protocole Socks sécuritaire ou +dangereux (voir l’entrée ci-dessus à propos de Socks +sécuritaire). Ceci aide à déterminer si une application utilisant +Tor divulgue possiblement des requêtes DNS.

+

Niveau de journalisation
+Définir le niveau +de journalisation du client Tor, toutes les sorties vont vers la +sortie standard pour éviter les écritures sur le disque.

+

Journalisation sécuritaire
+Activée, Tor +nettoiera les chaînes potentiellement sensibles des messages de +journalisation (p. ex. les adresses) en les remplaçant par la chaîne +[scrubbed] (nettoyée). De cette manière les journaux peuvent encore +être utiles, mais ils ne laissent apparaître aucune information +personnelle sur les sites qu’un utilisateur pourrait avoir +consultés.

+

Éviter les écritures sur le disque
+Activée, +Tor essaiera d’écrire moins fréquemment sur le disque que nous ne +le ferions autrement. Ceci est utile lors de l’exécution sur de la +mémoire flash ou autre support ne prenant en charge qu’un nombre +limité d’écritures.

+

Arguments de démarrage
+Ceci passera tout +argument de démarrage spécifié par l’utilisateur au client Tor, +voir le manuel de Tor pour une liste d’arguments valides en ligne +de commande.

+

Relais HTTP par défaut
+Vous pouvez +spécifier ici un serveur mandataire descendant. Tout ce qui n’est +pas acheminé par Tor sera envoyé au serveur mandataire. En laissant +ce champ vide, tout ce qui n’est pas acheminé par Tor sera envoyé +directement vers Internet. Ceci est la valeur par défaut.

+

Moniteur du client Tor

+

Arguments de démarrage
+
Affiche tous les +arguments passés au démarrage au client Tor.

+

Moniteur de sortie standard
+Affiche en temps +réel le flux de journalisation de la sortie standard du client Tor.

+

Modification des modèles de SelekTOR

+

Éditeur de modèles de relais
+L’éditeur +de modèles vous permet de modifier, ajouter, supprimer ou désactiver +les modèles d’URL utilisés pour réacheminer des URL spécifiques +par le mandataire Socks de Tor. N’utilisez ceci que si vous savez +ce que vous faites car toute erreur ici peut entraîner un échec +complet du relayage.

+

Ajout rapide d’un modèle
+L’ajout rapide +d’un modèle vous permet d’ajouter rapidement un nouveau modèle +pour le pays actuellement actif. Un exemple est donné ci-dessous :

+

Description : Newzbin
+Modèle : *newzbin.com*

+

Importer des modèles
+Les fichiers de +modèles sont stockés dans un fichier ZIP. Ce fichier ZIP peut être +importé directement dans SelekTOR en utilisant cette action.

+

Exporter des modèles
+Ceci vous permet +d’exporter tous les fichiers de modèles créés par l’utilisateur +comme fichier d’importation compressé compatible avec SelekTOR.

+

Informations complémentaires

+

Ce produit inclut des données de GeoLite2 data créé par +MaxMind, disponible sur http://www.maxmind.com.

+ + \ No newline at end of file diff --git a/packaging/doc/help-pt-br.html b/packaging/doc/help-pt-br.html new file mode 100644 index 0000000..9312016 --- /dev/null +++ b/packaging/doc/help-pt-br.html @@ -0,0 +1,235 @@ + + + + + Ajuda SelekTOR + + + + + + + + + + + + +

Opções da janela principal do SelekTOR

+

País ativo
+Selecione aqui o país de saída +que deseja. O SelekTOR irá buscar os nós de saída disponíveis +para eese país caso exista.

+

Modo do proxy : Desabilitado
+Proxy atravéz +do SelekTOR/Tor está desabilitado, SelekTOR não irá exercer nenhum +controle sob as configurações de proxy.
+Será necessária a +configuração manual de proxy do seu navegador web.

+

Modo do proxy : Proxy para todo tráfego
+Habilite +esse modo para que todo tráfego não roteado pelo Tor seja +redirecionado por esse proxy HTTP.
+Use circuitos de 3 saltos +para melhor anonimato (padrão no Tor)
+Não adequado para fluxos +multimedia.

+

Modo do proxy : Proxy por modelo
+Habilite +esse modo para usar o proxy Tor ativo seletivamente por modelo de +URLs.
+Use circuitos de 2 saltos para melhor latência com algum +sacrifício de anonimato.

+

Seleção de nós guarda
+
Abre a janela de +seleção de nós guarda.

+

Opções da tabela de nós (Clique direito)

+

Ativar nó
+Nós podem ser ativados +manualmente usando essa opção, você deve desabilitar o modo de +auto seleção se quiser que a ativação seja permanente.

+

Detalhe do nó
+Obtém os detalhes do nó +selecionado no seu navegador padrão, fornecido por Atlas.

+

Whois
+Fornece informações whois do nó +selecionado.

+

Inicia ciclo de teste
+Inicia um ciclo de +teste de nós.

+

Informação do circuito ativo

+

Apelido
+Apelido definido para o nó.

+

IP
+Endereço ip do nó.

+

País
+País em que cada nó está +localizado.

+

Largura de banda (MB/s)
+Esse indicador +mostra a largura de banda do nó ativo.

+

Estável
+Se o nó está ativo a tempo +suficiente para ser considerado estável.

+

Latência (ms)
+Esse indicador mostra a +latência da URL através do atual nó de saída. A latência fornece +uma indicação do tempo de resposta do nó em milissegundos, onde +1000ms = 1 segundo.

+

Fluxos
+Esse indicador mostra o número de +fluxos no nó ativo.

+

Opções da interface do SelekTor da bandeja +do sistema (Clique direito sobre o ícone da bandeja)

+

Modo: Sem proxy
+O proxy via Tor pode ser +desabilitado selecionando essa opção. Todo tráfego sairá +normalmente via internet.

+

Modo: Proxy para todo tráfego
+Habilite esse +modo para que todo tráfego passe através do proxy do Tor ativo. Use +circuitos de 3 saltos para melhor anonimato (padrão do Tor)
+Não +adequado para fluxos multimídia.

+

Modo: Proxy por modelo
+Habilite esse modo +para usar o proxy seletivamente por modelo de URLs através do nó +ativo do Tor.
+Use circuitos de 2 saltos para uma melhor latência +com algum sacrifício do anonimato.

+

Esconde/mostra GUI.
+Modifica a visualização +da interface gráfica (GUI).

+

Fechar SelekTOR.
+Fechar a aplicação.

+

Configuração básica do SelekTOR

+

Minimizar ao inciair
+
A GUI estará oculta na +iniciação, pode ser visível novamente dando um clique duplo no +ícone do SelekTOR na bandeja do sistema.

+

Iniciar o SelekTOR automaticamente
+O +SelekTOR irá iniciar no login.

+

Verificar atualizações ao iniciar.
+Verifica +se há atualizações do SelekTOR disponíveis em dazzleships.net.

+

Desabilita ícone da bandeja.
+Desabilita a +funcionalidade do ícone da bandeja.

+

Desabilita notificações
+Desabilita as +notificações do SelekTOR.

+

Minimizar ao iniciar
+
Minimizar o SelekTOR +quando iniciar.

+

Minimiar ao invés de fechar
+
Minimizar o +SelekTOR ao invés de sair ao clicar no ícone fechar.

+

Oculta ao invés de minimizar
+
Ao invés de +minimizar ocultar o SelekTOR completamente.

+

Apagar dados armazenados do Tor ao sair
+Apagamento +seguro do armazenamento do Tor que será renomeado e sobrescrito por +zeros antes de apagar.

+

Alertar se um nó guarda não especificado for usado
+
Abre +uma janela de alerta se selecionou nós guarda manualmente e um nó +não selecionado for usado. Essa condição só ocorre quando o Tor +não consegue conectar a nenhum dos nós guarda selecionados e +raramente ocorre. Se isso acontecer você deve verificar suas +seleções de nós guarda.

+

Opções avançadas do SelekTOR

+

Porta de esculta do Tor
+A porta de escuta +principal que o cliente Tor irá usar para conexões de entrada. +Normalmente qualquer que seja seu proxy a porta 9054 é a padrão do +SelekTOR.

+

Endereço de ponte do Tor
+Se precisar pular +bloqueios do provedor, selecione aqui um endereço válido de ponte +do TOR. Use o botão “Obter pontes” para encontrar endereços +válidos de pontes TOR.

+

Socks seguro
+Quando habilitado, o Tor irá +rejeitar conexões que usem variações inseguras do protocolo socks, +aquelas que fornecem apenas um endereço IP, significando que a +aplicação está usando DNS primeiro. Especificamente quando socks4 +e socks5 não estão usando um DNS remoto.

+

Alerta se inseguro
+Quando habilitado, o Tor +alertará toda vez que uma requisição recebida contenha apenas um +endereço de IP ao invés de um nome de máquina. Permitir que +aplicações façam resolução DNS por si mesmas é uma má ideia e +pode vazar sua localização aos atacantes.

+

Teste de Socks
+Quando habilitado, o Tor irá +gerar uma mensagem de log nível notificação para cada conexão +para a porta do socks, indicando quando a requisição usa socks +seguro ou inseguro (veja acima a entrada socks seguro). Isso ajuda a +determinar quando uma aplicação usando Tor está possivelmente +vazando requisições de DNS.

+

Nível de log
+Defina o nível de log do +cliente Tor. Toda saída irá para a saída padrão do console para +evitar escrita no disco. +

+

Log seguro
+Quando habilitado, o Tor irá +limpar o texto potencialmente crítico das mensagens de log, como +endereços, substituindo-os pelo texto [scrubbed]. Deste modo os logs +ainda podem ser úteis, mas não deixam informações de +identificação pessoal sobre os sites que um usuário possa ter +visitado.

+

Escrever no disco com menos frequência
+Quando +habilitado, o Tor tentará escrever no disco com menos frequência. +Isso é especialmente útil quando está usando cartões de memória +ou outro dispositivo que tenha limite do número de operações de +escrita.

+

Parâmetros iniciais
+Isso irá passar +parâmetros de iniciação específicos, definidos pelo usuário ao +cliente Tor. Veja o manual do Tor para obter uma lista de parâmetros +válidos.

+

Proxy HTTP padrão
+Você pode especificar +aqui um servidor proxy para que qualquer coisa que não vá através +do TOR seja enviada para esse proxy. Deixar em branco significa que o +que não passar pelo Tor irá diretamente via rede, esse é o padrão.

+

Monitor do cliente TOR

+

Parâmetros iniciais
+
Isso mostra todos os +parâmetros passados na iniciação do cliente Tor.

+

Monitor de saída
+
Isso mostra o fluxo das +mensagens do cliente Tor em tempo real.

+

Editor de modelo do SelekTOR

+

Editor de modelo de Proxy
+O editor de modelo +permite modificar, adicionar, apagar ou desabilitar modelos de URLs +através do proxy socks do Tor. Use isso apenas se souber o que está +fazendo, pois qualquer erro aqui pode fazer com que o proxy falhe +completamente.

+

Adicione modelo rapidamente
+Permite que +adicione rapidamente um novo modelo para o país atualmente ativo. +Segue um exemplo: +

+

Descrição: Newzbin
+Modelo: *newzbin.com*

+

Importar modelos
+Modelos são armazenados em +um arquivo Zip. Esse arquivo Zip pode ser importado para o SelekTOR +usando essa ação.

+

Exportar modelos
+Isso permite exportar todos +os seus modelos de usuário para um arquivo Zip compatível com o +arquivo de importação do SelekTOR.

+

Informações adicionais

+

Esse produto inclui os dados do GeoLite2 criado por MaxMind, +disponível em http://www.maxmind.com.

+ + \ No newline at end of file diff --git a/packaging/icons/selektor.png b/packaging/icons/selektor.png new file mode 100644 index 0000000..225f1ab Binary files /dev/null and b/packaging/icons/selektor.png differ diff --git a/packaging/man/man1/selektor.1.gz b/packaging/man/man1/selektor.1.gz new file mode 100644 index 0000000..833ef34 Binary files /dev/null and b/packaging/man/man1/selektor.1.gz differ diff --git a/packaging/selektor b/packaging/selektor new file mode 100755 index 0000000..ed8ce81 --- /dev/null +++ b/packaging/selektor @@ -0,0 +1,8 @@ +#!/bin/sh +# +# Startup script for SelekTOR +# We need to ensure we startup in the correct working directory +SELEKTOR_HOME=/usr/share/selektor +# Run our jar file +cd $SELEKTOR_HOME +java -Xms32m -Xmx64m -jar SelekTOR.jar "$@" & diff --git a/src/SelekTOR.java b/src/SelekTOR.java new file mode 100644 index 0000000..8b4acfd --- /dev/null +++ b/src/SelekTOR.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2014 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + * Explanation of why this is in the default package + * + * @author Alistair Neil + * + * The app launcher is here in the default package which should not normally be + * used. The method java uses to launche its apps is not fully compatible with + * various Linux launchers panels such as Dockbarx or Unity launchers and thus + * confuses those apps. By putting this simple launch handle here in the default + * package the Linux dockpanel launchers should function correctly when it + * commes to application pinning. + * + */ +public class SelekTOR { + + /** + * @param args the command line arguments + */ + public static void main(final String args[]) { + + java.awt.EventQueue.invokeLater(new Runnable() { + @Override + public void run() { + new client.SelekTOR(args); + } + }); + } + +} diff --git a/src/client/ExitNodeTableModel.java b/src/client/ExitNodeTableModel.java new file mode 100644 index 0000000..ee192a3 --- /dev/null +++ b/src/client/ExitNodeTableModel.java @@ -0,0 +1,246 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author Alistair Neil + */ +public class ExitNodeTableModel extends DefaultTableModel { + + private final List salFinger = Collections.synchronizedList(new ArrayList()); + private final String[] columnNames = new String[5]; + private NodeItem ni; + + public ExitNodeTableModel() { + } + + /** + * Clear the table model of all data + */ + public void clear() { + getDataVector().clear(); + salFinger.clear(); + } + + /** + * Get the number of columns + * + * @return columns as integer + */ + @Override + public int getColumnCount() { + return columnNames.length; + } + + /** + * Test if the cell is editable + * + * @param row Cell row + * @param col Cell column + * @return True if editable + */ + @Override + public boolean isCellEditable(int row, int col) { + return col == 4; + } + + /** + * Set value with given fingerprint at given column + * + * @param value Value + * @param finger Fingerprint + * @param col Column + */ + public void setValueAt(Object value, String finger, int col) { + setValueAt(value, salFinger.indexOf(finger), col); + } + + /** + * Convenience method to set the testing field cell values for a specific + * fingerprint, the hops field is hidden and does npt show up in table + * + * @param finger Fingerprint + * @param latency Latency value + * @param status Status value + * @param hops Hops value + */ + public synchronized void setTestFieldValues(String finger, long latency, String status, String hops) { + int row = salFinger.indexOf(finger); + if (row > -1) { + ni = (NodeItem) super.getValueAt(row, 0); + ni.setTestLatency(latency); + ni.setTestingMessage(status); + ni.setCircuitHops(hops); + fireTableRowsUpdated(row, row); + } + } + + /** + * Get row nodeitem + * + * @param row + * @return a nodeitem + */ + public NodeItem getNodeItemAt(int row) { + return (NodeItem) super.getValueAt(row, 0); + } + + /** + * Set cell value at row,col + * + * @param value + * @param row + * @param col + */ + @Override + public void setValueAt(Object value, int row, int col) { + try { + ni = (NodeItem) super.getValueAt(row, 0); + switch (col) { + case 1: + ni.setBandwidth((Float) value); + break; + case 2: + ni.setTestLatency((Long) value); + break; + case 3: + ni.setTestingMessage((String) value); + break; + case 4: + ni.setFavouriteEnabled((Boolean) value); + break; + case 5: + salFinger.set(row, (String) value); + ni.setFingerprint((String) value); + return; + case 6: + ni.setCircuitHops((String) value); + return; + } + fireTableCellUpdated(row, col); + } catch (Exception ex) { + } + } + + /** + * Get cell value as object at row,col + * + * @param row + * @param col + * @return value as object + */ + @Override + public Object getValueAt(int row, int col) { + ni = (NodeItem) super.getValueAt(row, 0); + Object obj = null; + switch (col) { + case 0: + obj = ni.getNickName(); + break; + case 1: + obj = ni.getBandwidth(); + break; + case 2: + obj = ni.getTestLatency(); + break; + case 3: + obj = ni.getTestingMessage(); + break; + case 4: + obj = ni.isFavourite(); + break; + case 5: + obj = ni.getFingerprint(); + break; + case 6: + obj = ni.getCircuitHops(); + break; + case 7: + obj = ni.getTestStatus(); + break; + } + return obj; + } + + /** + * Add rowdata with given data object array + * + * @param rowData + */ + @Override + public void addRow(Object[] rowData) { + super.addRow(rowData); + salFinger.add(((NodeItem) rowData[0]).getFingerprint()); + } + + /** + * Get column name at given index + * + * @param index + * @return name as string + */ + @Override + public String getColumnName(int index) { + return columnNames[index]; + } + + /** + * Set the column name at the specified index + * + * @param name + * @param index + */ + public void setColumnName(String name, int index) { + if (index < columnNames.length) { + columnNames[index] = name; + } + } + + /** + * Get column class at given index + * + * @param index + * @return Class + */ + @Override + public Class getColumnClass(int index) { + Class cl; + switch (index) { + case 1: + cl = Float.class; + break; + case 2: + cl = Long.class; + break; + case 4: + cl = Boolean.class; + break; + default: + cl = String.class; + break; + } + return cl; + } + +} diff --git a/src/client/GuardNodeDialog.form b/src/client/GuardNodeDialog.form new file mode 100644 index 0000000..5cad394 --- /dev/null +++ b/src/client/GuardNodeDialog.form @@ -0,0 +1,177 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/client/GuardNodeDialog.java b/src/client/GuardNodeDialog.java new file mode 100644 index 0000000..9bd6194 --- /dev/null +++ b/src/client/GuardNodeDialog.java @@ -0,0 +1,299 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import java.awt.event.MouseEvent; +import javax.swing.event.TableModelEvent; +import lib.GTKFixes; +import lib.Localisation; +import lib.Utilities; + +/** + * + * @author Alistair Neil + */ +public class GuardNodeDialog extends javax.swing.JDialog { + + public static final int CANCEL = 0; + public static final int APPLY = 1; + public static final int RESET = 2; + private static final String ATLAS = "https://atlas.torproject.org/"; + private static final Localisation LOCAL = new Localisation("resources/MessagesBundle"); + private int intRowSelected = -1; + private int returnStatus = CANCEL; + private final GuardNodeTableModel gntm; + private NodeList nl; + + /** + * Creates new form GuardNodeDialog + * + * @param parent + * @param modal + */ + public GuardNodeDialog(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + GTKFixes.fixTextAreaColor(jTextArea1); + jTableGuards.setComponentPopupMenu(popupTable); + gntm = new GuardNodeTableModel(); + gntm.setColumnName(LOCAL.getString("guardtable_col1"), 0); + gntm.setColumnName(LOCAL.getString("guardtable_col2"), 1); + gntm.setColumnName(LOCAL.getString("guardtable_col3"), 2); + gntm.setColumnName(LOCAL.getString("guardtable_col4"), 3); + gntm.addTableModelListener(new javax.swing.event.TableModelListener() { + + @Override + public void tableChanged(TableModelEvent e) { + if (gntm.getEnabledCount() >= 3 || gntm.getEnabledCount() == 0) { + jButtonApply.setEnabled(true); + } else { + jButtonApply.setEnabled(false); + } + } + }); + + jTableGuards.setModel(gntm); + adjustGuardTableColumns(); + } + + /** + * Set the nodelist + * + * @param nl + */ + public void setNodeList(NodeList nl) { + this.nl = nl; + this.nl.setGuardNodeTableModel(gntm); + this.nl.refreshGuardTableModel(); + adjustGuardTableColumns(); + } + + /** + * Adjust guard table column widths + */ + private void adjustGuardTableColumns() { + // Adjust table column widths + Utilities.adjustTableColumnWidth(jTableGuards, + "XXXXXXXXXXXXXXXXXXXXXXXXXXX", + "XXXXXXXXXXXXXXXXXXXXXXXXXXX", + "XXXXXXXXXXXXXXX", + "XXXXXXXXXXXXXXX"); + } + + private void clearSelections() { + + for (int row = 0; row < jTableGuards.getRowCount(); row++) { + jTableGuards.setValueAt(false, row, 3); + } + } + + private void doClose(int retStatus) { + returnStatus = retStatus; + setVisible(false); + dispose(); + } + + /** + * @return the return status of this dialog - one of RET_OK or RET_CANCEL + */ + public int getReturnStatus() { + return returnStatus; + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + popupTable = new javax.swing.JPopupMenu(); + jMenuNodeDetails = new javax.swing.JMenuItem(); + jMenuWhois = new javax.swing.JMenuItem(); + jScrollPane1 = new javax.swing.JScrollPane(); + jTableGuards = new javax.swing.JTable(); + jButtonClear = new javax.swing.JButton(); + jButtonApply = new javax.swing.JButton(); + jButtonClose = new javax.swing.JButton(); + jTextArea1 = new javax.swing.JTextArea(); + + popupTable.addPopupMenuListener(new javax.swing.event.PopupMenuListener() { + public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) { + popupTablePopupMenuWillBecomeVisible(evt); + } + public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) { + } + public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) { + } + }); + + jMenuNodeDetails.setText(LOCAL.getString("table_popup_details")); // NOI18N + jMenuNodeDetails.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuNodeDetailsActionPerformed(evt); + } + }); + popupTable.add(jMenuNodeDetails); + + jMenuWhois.setText(LOCAL.getString("table_popup_whois")); // NOI18N + jMenuWhois.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuWhoisActionPerformed(evt); + } + }); + popupTable.add(jMenuWhois); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle(LOCAL.getString("wintitle_guardnodes")); // NOI18N + setResizable(false); + + jTableGuards.setAutoCreateRowSorter(true); + jTableGuards.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); + jTableGuards.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jTableGuardsMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(jTableGuards); + + jButtonClear.setText(LOCAL.getString("button_clearguards")); // NOI18N + jButtonClear.setToolTipText(LOCAL.getString("ttip_clearguards")); // NOI18N + jButtonClear.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonClearActionPerformed(evt); + } + }); + + jButtonApply.setText(LOCAL.getString("button_apply")); // NOI18N + jButtonApply.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonApplyActionPerformed(evt); + } + }); + + jButtonClose.setText(LOCAL.getString("button_close")); // NOI18N + jButtonClose.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonCloseActionPerformed(evt); + } + }); + + jTextArea1.setEditable(false); + jTextArea1.setColumns(40); + jTextArea1.setFont(new javax.swing.JLabel().getFont()); + jTextArea1.setLineWrap(true); + jTextArea1.setRows(2); + jTextArea1.setText(LOCAL.getString("label_guard_minimum")); // NOI18N + jTextArea1.setWrapStyleWord(true); + jTextArea1.setDisabledTextColor(jTextArea1.getForeground()); + jTextArea1.setEnabled(false); + jTextArea1.setMinimumSize(new java.awt.Dimension(0, 0)); + jTextArea1.setOpaque(false); + jTextArea1.setRequestFocusEnabled(false); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jButtonClear) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonClose) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonApply)) + .addComponent(jTextArea1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jScrollPane1)) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jTextArea1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 367, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButtonClear) + .addComponent(jButtonApply) + .addComponent(jButtonClose)) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + + private void jButtonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed + doClose(CANCEL); + }//GEN-LAST:event_jButtonCloseActionPerformed + + private void jButtonApplyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonApplyActionPerformed + nl.saveGuardWhitelist(); + doClose(APPLY); + }//GEN-LAST:event_jButtonApplyActionPerformed + + private void jButtonClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClearActionPerformed + clearSelections(); + }//GEN-LAST:event_jButtonClearActionPerformed + + private void jMenuNodeDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuNodeDetailsActionPerformed + String finger = (String) gntm.getValueAt(intRowSelected, 4); + finger = finger.replace("$", ""); + Utilities.openFileExternally(ATLAS + "#details/" + finger); + }//GEN-LAST:event_jMenuNodeDetailsActionPerformed + + private void jMenuWhoisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuWhoisActionPerformed + String finger = (String) gntm.getValueAt(intRowSelected, 4); + NodeItem ni = nl.getNode(finger); + if (ni != null) { + Utilities.openFileExternally("https://www.networksolutions.com/whois/results.jsp?ip=" + ni.getIPAddress()); + } + }//GEN-LAST:event_jMenuWhoisActionPerformed + + private void popupTablePopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_popupTablePopupMenuWillBecomeVisible + jMenuWhois.setEnabled(intRowSelected > -1); + jMenuNodeDetails.setEnabled(intRowSelected > -1); + }//GEN-LAST:event_popupTablePopupMenuWillBecomeVisible + + private void jTableGuardsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableGuardsMouseClicked + if (evt.getButton() != MouseEvent.BUTTON1) { + return; + } + intRowSelected = jTableGuards.getSelectedRow(); + if (intRowSelected > 0) { + intRowSelected = jTableGuards.convertRowIndexToModel(intRowSelected); + } + }//GEN-LAST:event_jTableGuardsMouseClicked + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButtonApply; + private javax.swing.JButton jButtonClear; + private javax.swing.JButton jButtonClose; + private javax.swing.JMenuItem jMenuNodeDetails; + private javax.swing.JMenuItem jMenuWhois; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTable jTableGuards; + private javax.swing.JTextArea jTextArea1; + private javax.swing.JPopupMenu popupTable; + // End of variables declaration//GEN-END:variables +} diff --git a/src/client/GuardNodeTableModel.java b/src/client/GuardNodeTableModel.java new file mode 100644 index 0000000..3fa1acb --- /dev/null +++ b/src/client/GuardNodeTableModel.java @@ -0,0 +1,203 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author Alistair Neil + */ +public class GuardNodeTableModel extends DefaultTableModel { + + private final List salFinger = Collections.synchronizedList(new ArrayList()); + private final String[] columnNames = {"GuardNode", "Country", "BW (MB\\s)", "Trusted"}; + private NodeItem ni; + private int enabledcount; + + public GuardNodeTableModel() { + } + + public int getEnabledCount() { + return enabledcount; + } + + /** + * Clear the table model of all data + */ + public void clear() { + getDataVector().clear(); + salFinger.clear(); + enabledcount = 0; + } + + /** + * Get the number of columns + * + * @return columns as integer + */ + @Override + public int getColumnCount() { + return columnNames.length; + } + + /** + * Test if the cell is editable + * + * @param row Cell row + * @param col Cell column + * @return True if editable + */ + @Override + public boolean isCellEditable(int row, int col) { + return col == 3; + } + + /** + * Set value with given fingerprint at given column + * + * @param value Value + * @param finger Fingerprint + * @param col Column + */ + public void setValueAt(Object value, String finger, int col) { + setValueAt(value, salFinger.indexOf(finger), col); + } + + /** + * Set cell value at row,col + * + * @param value + * @param row + * @param col + */ + @Override + public void setValueAt(Object value, int row, int col) { + try { + ni = (NodeItem) super.getValueAt(row, 0); + if (col == 3) { + ni.setGuardEnabled((Boolean) value); + if (ni.isGuardEnabled()) { + enabledcount++; + } else { + if (enabledcount > 0) { + enabledcount--; + } + } + fireTableCellUpdated(row, col); + } + } catch (Exception ex) { + } + } + + /** + * Get cell value as object at row,col + * + * @param row + * @param col + * @return value as object + */ + @Override + public Object getValueAt(int row, int col) { + ni = (NodeItem) super.getValueAt(row, 0); + Object obj = null; + switch (col) { + case 0: + obj = ni.getNickName(); + break; + case 1: + obj = ni.getCountryName(); + break; + case 2: + obj = ni.getBandwidth(); + break; + case 3: + obj = ni.isGuardEnabled(); + break; + case 4: + obj = ni.getFingerprint(); + break; + } + return obj; + } + + /** + * Add rowdata with given data object array + * + * @param rowData + */ + @Override + public void addRow(Object[] rowData) { + super.addRow(rowData); + ni = (NodeItem) rowData[0]; + if (ni.isGuardEnabled()) { + enabledcount++; + } + salFinger.add(ni.getFingerprint()); + } + + /** + * Get column name at given index + * + * @param index + * @return name as string + */ + @Override + public String getColumnName(int index) { + return columnNames[index]; + } + + /** + * Set the column name at the specified index + * + * @param name + * @param index + */ + public void setColumnName(String name, int index) { + if (index < columnNames.length) { + columnNames[index] = name; + } + } + + /** + * Get column class at given index + * + * @param index + * @return Class + */ + @Override + public Class getColumnClass(int index) { + Class cl; + switch (index) { + case 2: + cl = Float.class; + break; + case 3: + cl = Boolean.class; + break; + default: + cl = String.class; + break; + } + return cl; + } + +} diff --git a/src/client/NodeItem.java b/src/client/NodeItem.java new file mode 100644 index 0000000..6a0fd7b --- /dev/null +++ b/src/client/NodeItem.java @@ -0,0 +1,405 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import java.text.DecimalFormat; + +/** + * + * @author Alistair Neil + */ +public class NodeItem extends Object implements Cloneable { + + public static final int TYPE_EXIT = 1; + public static final int TYPE_GUARD = 2; + public static final int TESTSTATUS_UNKNOWN = 0; + public static final int TESTSTATUS_PASSED = 1; + public static final int TESTSTATUS_FAILED = 2; + private int type; + private boolean exitFavourite; + private boolean guardEnabled; + private boolean httpSupported; + private String stable; + private String countrycode; + private String countryname; + private String nickname; + private String finger; + private String ipaddress; + private String testingmess; + private String circuithops; + private int teststatus; + private float bandwidth; + private int streams; + private long latency; + private long testlatency; + + public NodeItem() { + this.type = 0; + this.exitFavourite = false; + this.guardEnabled = false; + this.httpSupported = false; + this.countrycode = null; + this.latency = 9999; + this.testlatency = this.latency; + this.bandwidth = 0; + this.streams = 0; + this.countrycode = ""; + this.countryname = ""; + this.stable = ""; + this.testingmess = ""; + this.ipaddress = ""; + this.finger = ""; + this.nickname = ""; + this.teststatus = TESTSTATUS_UNKNOWN; + } + + /** + * Set Node type + * + * @param mask + */ + public final void setType(int mask) { + this.type |= mask; + } + + /** + * Clear node type + */ + public final void clearType() { + this.type = 0; + } + + public boolean isNonUnique() { + return (nickname.contains("Default") + || nickname.contains("default") + || nickname.contains("Unnamed")); + } + + /** + * Is exit node + * + * @return true if an exit node + */ + public final boolean isExit() { + return (type & TYPE_EXIT) != 0; + } + + public boolean isHttpSupported() { + return httpSupported; + } + + public void setHttpSupported(boolean supported) { + httpSupported = supported; + } + + /** + * Is Guard node + * + * @return true if guard node + */ + public final boolean isGuard() { + return (type & TYPE_GUARD) != 0; + } + + /** + * Set circuit hops + * + * @param hops + */ + public final void setCircuitHops(String hops) { + circuithops = hops; + } + + /** + * Get circuit hops + * + * @return Circuit hops as String + */ + public final String getCircuitHops() { + return circuithops; + } + + /** + * Set Nodeitem testing status message + * + * @param text + */ + public final void setTestingMessage(String text) { + this.testingmess = text; + } + + /** + * Set testing status flag + * + * @param status + */ + public final void setTestStatus(int status) { + teststatus = status; + } + + /** + * Get testing status flag + * + * @return test status + */ + public final int getTestStatus() { + return teststatus; + } + + /** + * Get Node item status + * + * @return Nodeitem testing status message as string + */ + public final String getTestingMessage() { + return testingmess; + } + + /** + * Set Nodeitem latency value in ms + * + * @param latency + */ + public final void setLatency(long latency) { + this.latency = latency; + } + + /** + * Get Nodeitem latency in ms + * + * @return Latency value in ms + */ + public final long getLatency() { + return latency; + } + + /** + * Set Nodeitem test latency value in ms + * + * @param latency + */ + public final void setTestLatency(long latency) { + this.testlatency = latency; + } + + /** + * Get Nodeitem test latency in ms + * + * @return Latency value in ms + */ + public final long getTestLatency() { + return testlatency; + } + + /** + * Set exit enabled status of Nodeitem + * + * @param enabled + */ + public final void setFavouriteEnabled(boolean enabled) { + this.exitFavourite = enabled; + } + + /** + * Get exit enabled status of Nodeitem + * + * @return true if enabled + */ + public final boolean isFavourite() { + return exitFavourite; + } + + /** + * Set guard enabled status of Nodeitem + * + * @param enabled + */ + public final void setGuardEnabled(boolean enabled) { + this.guardEnabled = enabled; + } + + /** + * Get guard enabled status of Nodeitem + * + * @return true if enabled + */ + public final boolean isGuardEnabled() { + return guardEnabled; + } + + /** + * Set Nodeitem stability yes/no/unknown + * + * @param stability + */ + public final void setStable(String stability) { + this.stable = stability; + } + + /** + * Get Nodeitem stability + * + * @return Stability + */ + public final String getStability() { + return stable; + } + + /** + * Set Nodeitem with its two letter country code abbreviation + * + * @param abrv + */ + public final void setCountryCode(String abrv) { + countrycode = abrv; + } + + /** + * Get nodeitem two letter country code abbreviation + * + * @return Country code as string + */ + public final String getCountryCode() { + return countrycode; + } + + /** + * Set Nodeitem with its full country name + * + * @param name + */ + public final void setCountryName(String name) { + countryname = name; + } + + /** + * Get nodeitem full country name + * + * @return Country name as string + */ + public final String getCountryName() { + return countryname; + } + + /** + * Set nodeitem name + * + * @param name + */ + public final void setNickName(String name) { + nickname = name; + } + + /** + * Get nodeitem unique name + * + * @return Node name as string + */ + public final String getNickName() { + return nickname; + } + + /** + * Set node item bandwidth + * + * @param bw + */ + public final void setBandwidth(float bw) { + bandwidth = bw; + } + + /** + * Get nodeitem bandwith + * + * @return Bandwidth as long, in kb/s + */ + public final float getBandwidth() { + Float result; + try { + DecimalFormat df = new DecimalFormat("#0.##"); + result = Float.parseFloat(df.format(bandwidth).replace(",", ".")); + } catch (Exception ex) { + result = (float) 0; + } + return result; + } + + /** + * Set nodeitem number of streams + * + * @param streams + */ + public final void setStreams(int streams) { + this.streams = streams; + } + + /** + * Get nodeitems active streams + * + * @return Number of active streams as int + */ + public final int getStreams() { + return streams; + } + + /** + * Set nodeitem fingerprint + * + * @param fp + */ + public final void setFingerprint(String fp) { + finger = fp; + } + + /** + * Get nodeitems fingerprint + * + * @return Tor node fingerprint as string + */ + public final String getFingerprint() { + return finger; + } + + /** + * Set nodeitem ip address + * + * @param ip + */ + public final void setIPAddress(String ip) { + ipaddress = ip; + } + + /** + * Get nodeitem ip address + * + * @return IP address as a string + */ + public final String getIPAddress() { + return ipaddress; + } + + @Override + public NodeItem clone() { + try { + return (NodeItem) super.clone(); + } catch (CloneNotSupportedException ex) { + return null; + } + } + +} diff --git a/src/client/NodeList.java b/src/client/NodeList.java new file mode 100644 index 0000000..17b43b2 --- /dev/null +++ b/src/client/NodeList.java @@ -0,0 +1,757 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import java.text.Collator; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.regex.Pattern; +import lib.Localisation; +import lib.SimpleFile; + +/** + * + * @author Alistair Neil + */ +public class NodeList { + + public static final int NODELIST_IDLE = 0; + public static final int NODELIST_BUILDING = 1; + public static final int NODELIST_BUILT = 2; + public static final int NODELIST_FAILED = 3; + public static final int NODELIST_TERMINATED = 4; + private static final String EMPTYSTRING = ""; + private static final Localisation LOCAL = new Localisation("resources/MessagesBundle"); + private ExitNodeTableModel entm; + private GuardNodeTableModel gntm; + private int intStatus = NODELIST_IDLE; + private HashMap hmNode; + private final HashMap hmBridges; + private final ArrayList alCountries; + private TorController tc; + private final String exitFavouritesFile; + private final String guardFavouritesFile; + private final String filepath; + private volatile boolean boolAbortActions; + private final Pattern pattspace = Pattern.compile(" "); + private int nooffavs; + + public NodeList(String filepath, String exitfavourites, String guardfavouritesfile) { + this.hmNode = new HashMap<>(); + this.hmBridges = new HashMap<>(); + this.filepath = filepath; + this.alCountries = new ArrayList<>(); + this.exitFavouritesFile = exitfavourites; + this.guardFavouritesFile = guardfavouritesfile; + } + + /** + * Get node item from its fingerprint + * + * @param key or fingerprint + * @return NodeItem + */ + public final NodeItem getNode(String key) { + String temp; + NodeItem ni = hmNode.get(key); + if (ni == null) { + // No bridge found so must be a new node not currently in nodelist + ArrayList alRouterInfo = getRouterDesc(key); + if (alRouterInfo != null) { + alRouterInfo.addAll(getRouterStatus(key)); + ni = new NodeItem(); + temp = filterRouterInfo(alRouterInfo, "router "); + if (temp == null) { + return null; + } + String[] data = pattspace.split(temp); + ni.setFingerprint(key); + ni.setNickName(data[0]); + ni.setIPAddress(data[1]); + String isocode = tc.getCountryFromIP(ni.getIPAddress()); + if (isocode == null || isocode.contentEquals("??")) { + isocode = "U1"; + } + ni.setCountryCode(isocode); + ni.setCountryName(LOCAL.getDisplayCountry(isocode)); + temp = filterRouterInfo(alRouterInfo, "bandwidth "); + data = pattspace.split(temp); + ni.setBandwidth(getLowestBandwidth(data)); + temp = filterRouterInfo(alRouterInfo, "s "); + if (temp == null) { + // We probably have a bridge + ni.setType(NodeItem.TYPE_GUARD); + ni.setStable(LOCAL.getString("text_yes")); + return ni; + } + if (temp.contains("Guard")) { + ni.setType(NodeItem.TYPE_GUARD); + } + if (temp.contains("Stable")) { + ni.setStable(LOCAL.getString("text_yes")); + } else { + ni.setStable(LOCAL.getString("text_no")); + } + if (temp.contains("Exit") && !temp.contains("BadExit")) { + ni.setType(NodeItem.TYPE_EXIT); + temp = filterRouterInfo(alRouterInfo, "p "); + if (temp.startsWith("accept")) { + temp = temp.replace("accept ", ""); + if (!containsPort(temp, 80) && !containsPort(temp, 443)) { + return ni; + } + } else { + temp = temp.replace("reject ", ""); + if (containsPort(temp, 80) || containsPort(temp, 443)) { + return ni; + } + } + ni.setHttpSupported(true); + } + } + } + return ni; + } + + public ArrayList getRouterDesc(String finger) { + ArrayList alResult = tc.getInfo("desc/id/" + finger); + if (alResult == null) { + return null; + } + alResult.remove("250 OK"); + if (alResult.isEmpty()) { + return null; + } + return alResult; + } + + public ArrayList getRouterStatus(String finger) { + ArrayList alResult = tc.getInfo("ns/id/" + finger); + if (alResult == null) { + return null; + } + alResult.remove("250 OK"); + if (alResult.isEmpty()) { + return null; + } + return alResult; + } + + public String filterRouterInfo(ArrayList alInfo, String field) { + for (String s : alInfo) { + if (s.startsWith(field)) { + return s.replace(field, ""); + } + } + return null; + } + + /** + * Get the process status + * + * @return status + */ + public final int getCurrentStatus() { + return intStatus; + } + + /** + * Generate the nodelist + * + * @param tc + */ + public final void refreshNodelist(TorController tc) { + boolAbortActions = false; + intStatus = NODELIST_BUILDING; + this.tc = tc; + boolean boolSuccess = populateNodeMap(); + if (boolSuccess) { + boolSuccess = fetchFingerData(); + } + if (boolSuccess) { + intStatus = NODELIST_BUILT; + } else if (boolAbortActions) { + intStatus = NODELIST_TERMINATED; + } else { + intStatus = NODELIST_FAILED; + } + } + + /** + * Update internal node mappings + * + */ + private boolean populateNodeMap() { + String strFlags; + String data[]; + String temp; + String strNick; + String strIP; + String strCountryName; + String strCountryCode; + String strPerms; + String strDirPort; + String strOrPort; + + NodeItem ni; + + SimpleFile sfConsensus = new SimpleFile(tc.getDataFolder() + SimpleFile.getSeparator() + "cached-consensus"); + + hmNode.clear(); + alCountries.clear(); + sfConsensus.openBufferedRead(); + while (!boolAbortActions) { + temp = sfConsensus.readLine(); + // Test for end of node info file + if (temp.startsWith("directory-footer")) { + break; + } + + // Test for node info line + if (temp.startsWith("r ")) { + data = pattspace.split(temp); + strNick = data[1]; + strIP = data[6]; + strOrPort = data[7]; + strDirPort = data[8]; + + // Read flags line + while (true) { + strFlags = sfConsensus.readLine(); + if (strFlags.startsWith("s ")) { + break; + } + } + // Ignore certain types of node + if (!strFlags.contains("Running") + || !strFlags.contains("Valid")) { + continue; + } + + // Read port permissions line + while (true) { + strPerms = sfConsensus.readLine(); + if (strPerms.startsWith("p ")) { + break; + } + } + + // Check if Tor is fully active + if (tc.getStatus() < TorController.STATUS_IDLE) { + boolAbortActions = false; + alCountries.clear(); + break; + } + + // Get country code from ip address + strCountryCode = tc.getCountryFromIP(strIP); + if (strCountryCode == null || strCountryCode.contains("??")) { + strCountryCode = "U1"; + } + + // If we get GEOIP errors then abort + if (strCountryCode.startsWith("551 GEOIP")) { + alCountries.clear(); + break; + } + + // Get country name + strCountryName = LOCAL.getDisplayCountry(strCountryCode); + + ni = new NodeItem(); + // Update our node item fields now that we have validated our node + ni.setCountryCode(strCountryCode); + ni.setCountryName(strCountryName); + ni.setNickName(strNick); + ni.setIPAddress(strIP); + // Get stableflag + if (strFlags.contains("Stable")) { + ni.setStable(LOCAL.getString("text_yes")); + } else { + ni.setStable(LOCAL.getString("text_no")); + } + + hmNode.put(strOrPort + strDirPort + ":" + strIP, ni); + + // Check if a guard node + if (strFlags.contains("Guard")) { + ni.setType(NodeItem.TYPE_GUARD); + } + + // Check if an exit node also exclude nodes flagged as bad exits + if (strFlags.contains("Exit") && !strFlags.contains("BadExit")) { + ni.setType(NodeItem.TYPE_EXIT); + // Simple test on port permissions, we will only allow node + // if it accepts connections on port 80 and 443 for web browsing + if (strPerms.startsWith("p accept")) { + strPerms = strPerms.replace("p accept ", ""); + if (!containsPort(strPerms, 80)) { + continue; + } + if (!containsPort(strPerms, 443)) { + continue; + } + } else { + strPerms = strPerms.replace("p reject ", ""); + if (containsPort(strPerms, 80)) { + continue; + } + if (containsPort(strPerms, 443)) { + continue; + } + } + ni.setHttpSupported(true); + + // Ensure we only add exit country info in once to validated countries list + if (!alCountries.contains(strCountryCode + "," + strCountryName)) { + alCountries.add(strCountryCode + "," + strCountryName); + } + } + } + } + sfConsensus.closeFile(); + + // Sort our country validation list + if (alCountries.isEmpty()) { + return false; + } else { + Collections.sort(alCountries, Collator.getInstance()); + } + return !boolAbortActions; + } + + /** + * Update internal finger mappings + * + */ + private boolean fetchFingerData() { + int idx; + String line; + String data[]; + String ipaddress; + String finger; + String strOrPort; + String strDirPort; + String key; + boolean result; + + String guardwhitelist = getGuardFavouritesAsCSV(); + NodeItem ni; + HashMap hmNodeReplacement = new HashMap<>(); + + SimpleFile sfDescriptors = new SimpleFile(tc.getDataFolder() + SimpleFile.getSeparator() + "cached-descriptors"); + SimpleFile sfDescriptorsNew = new SimpleFile(tc.getDataFolder() + SimpleFile.getSeparator() + "cached-descriptors.new"); + if (!sfDescriptorsNew.exists() || sfDescriptorsNew.getFile().length() == 0) { + sfDescriptorsNew = null; + } + + sfDescriptors.openBufferedRead(); + try { + while (!boolAbortActions) { + line = sfDescriptors.readLine(); + // If line is null we have then processed the main descriptors file + if (line == null) { + // Check if their is a descriptors new file + if (sfDescriptorsNew == null) { + break; + } else { + sfDescriptors.closeFile(); + sfDescriptors = sfDescriptorsNew; + sfDescriptors.openBufferedRead(); + sfDescriptorsNew = null; + continue; + } + } + + if (line.startsWith("router ")) { + data = pattspace.split(line); + ipaddress = data[2]; + strOrPort = data[3]; + strDirPort = data[5]; + key = strOrPort + strDirPort + ":"; + if (!hmNode.containsKey(key + ipaddress)) { + continue; + } + + // Get fingerprint + while (true) { + line = sfDescriptors.readLine(); + idx = line.indexOf("fingerprint"); + if (idx > -1) { + line = line.substring(idx + 12); + break; + } + } + finger = "$" + line.replace(" ", EMPTYSTRING); + + // Get bandwidth + while (true) { + line = sfDescriptors.readLine(); + idx = line.indexOf("bandwidth"); + if (idx > -1) { + line = line.substring(idx + 10); + break; + } + } + data = pattspace.split(line); + ni = hmNode.get(key + ipaddress); + ni.setFingerprint(finger); + ni.setGuardEnabled(guardwhitelist.contains(finger)); + ni.setBandwidth(getLowestBandwidth(data)); + hmNodeReplacement.put(finger, ni); + } + } + result = !boolAbortActions; + } catch (Exception ex) { + result = false; + } + sfDescriptors.closeFile(); + // Replace our original ipaddress keyed nodemap with our fingerprint keyed nodemap + hmNode = hmNodeReplacement; + return result; + } + + /** + * Return the lowest bandwidth + * + * @param data + * @return bandwidth as float + */ + private float getLowestBandwidth(String[] data) { + float bw = 1000000; + float tmp; + for (String s : data) { + tmp = Float.parseFloat(s) / 1000000; + if (tmp < bw) { + bw = tmp; + } + } + return bw; + } + + /** + * Add newly learned bridge to nodelist + * + * @param bridgedata + */ + public void addBridge(String bridgedata) { + Pattern pat = Pattern.compile(" "); + bridgedata = bridgedata.substring(bridgedata.indexOf('$')); + String[] data = pat.split(bridgedata); + int index = data[0].indexOf('~'); + if (index < 0) { + index = data[0].indexOf('='); + } + NodeItem ni = new NodeItem(); + ni.setFingerprint(data[0].substring(0, index)); + ni.setIPAddress(data[2]); + ni.setNickName(data[0].substring(index + 1)); + hmBridges.put(ni.getFingerprint(), ni); + } + + /** + * Clear any learned bridges + */ + public void clearBridges() { + hmBridges.clear(); + } + + /** + * Test to check supplied data contains the specified port + * + * @param data + * @param port + * @return True if data contains specified port + */ + private boolean containsPort(String data, int port) { + String strRanges[]; + String[] strPorts; + int rangemin; + int rangemax; + Pattern pattcomma = Pattern.compile(","); + Pattern pattminus = Pattern.compile("-"); + strRanges = pattcomma.split(data); + for (String s : strRanges) { + // Test to see if its a range of ports + if (s.contains("-")) { + strPorts = pattminus.split(s); + rangemin = Integer.parseInt(strPorts[0]); + rangemax = Integer.parseInt(strPorts[1]); + if (port >= rangemin && port <= rangemax) { + return true; + } + } else { + // We have a single port + rangemin = Integer.parseInt(s); + if (port == rangemin) { + return true; + } + } + } + return false; + } + + /** + * Gets validated countries, a valid country is any country with active exit + * nodes + * + * @return String array of countries + */ + public final String[] getValidatedCountries() { + return alCountries.toArray(new String[alCountries.size()]); + } + + /** + * Gets validated country codes, a valid country is any country with active + * exit nodes + * + * @return String array of country abbreviations + */ + public final String[] getValidatedCountryCodes() { + String[] result = new String[alCountries.size()]; + int idx = 0; + for (String s : alCountries) { + result[idx++] = s.substring(0, 2); + } + return result; + } + + /** + * Set the guard node view table model + * + * @param gntm + */ + public final void setGuardNodeTableModel(GuardNodeTableModel gntm) { + this.gntm = gntm; + } + + /** + * Set the exit node view table model + * + * @param entm + */ + public final void setExitNodeTableModel(ExitNodeTableModel entm) { + this.entm = entm; + } + + /** + * Get a list of exitnodes, if all is false then it returns only favourited + * nodes, if omitfailednodes is true then don't include nodes that failed + * testing + * + * @param all + * @param omitfailednodes + * @return ArrayList of exit nodes + */ + public final ArrayList getExitNodes(boolean all, boolean omitfailednodes) { + ArrayList al = new ArrayList<>(); + for (int i = 0; i < entm.getRowCount(); i++) { + int teststatus = (Integer) entm.getValueAt(i, 7); + if (omitfailednodes && teststatus == NodeItem.TESTSTATUS_FAILED) { + continue; + } + boolean fave = (Boolean) entm.getValueAt(i, 4) | all; + if (fave) { + al.add((String) entm.getValueAt(i, 5)); + } + } + return al; + } + + /** + * Get a string of comma separated exitnodes, if all is false then it + * returns only favourited nodes, if omitfailednodes is true then don't + * include nodes that failed testing + * + * @param all + * @param omitfailednodes + * @return String of exitnodes in csv format + */ + public final String getExitNodesAsString(boolean all, boolean omitfailednodes) { + String result = getExitNodes(all, omitfailednodes).toString(); + result = result.replace("[", "").replace(" ", "").replace("]", ""); + return result; + } + + /** + * Get a list of all guard nodes guard nodes + * + * @return ArrayList of guard nodes + */ + public final ArrayList getGuardNodes() { + ArrayList al = new ArrayList<>(); + if (gntm == null) { + return al; + } + for (int i = 0; i < gntm.getRowCount(); i++) { + al.add((String) gntm.getValueAt(i, 3)); + } + return al; + } + + /** + * Get guard favourites + * + * @return CSV string of guard entry fingerprints + */ + public final String getGuardFavouritesAsCSV() { + StringBuilder sbResult = new StringBuilder(); + String line; + String sep = ""; + if (guardFavouritesFile == null) { + return sbResult.toString(); + } + SimpleFile sf = new SimpleFile(filepath + guardFavouritesFile); + if (!sf.exists()) { + return sbResult.toString(); + } + sf.openBufferedRead(); + while ((line = sf.readLine()) != null) { + sbResult.append(sep); + sbResult.append(line); + if (sep.isEmpty()) { + sep = ","; + } + } + sf.closeFile(); + return sbResult.toString(); + } + + /** + * Update the guard node table model + */ + public final void refreshGuardTableModel() { + if (gntm == null) { + return; + } + NodeItem ni; + gntm.clear(); + // Populate model + for (String s : hmNode.keySet()) { + ni = hmNode.get(s); + if (ni.isGuard()) { + Object[] rowData = new Object[]{ni}; + gntm.addRow(rowData); + } + } + } + + /** + * Update the table model based on supplied country + * + * + * @param isocountry in the format "GB,Great Britain" + */ + public final void refreshExitTableModel(String isocountry) { + if (entm == null) { + return; + } + NodeItem ni; + entm.clear(); + String abbrv = isocountry; + String favourites = ""; + if (exitFavouritesFile != null) { + SimpleFile sf = new SimpleFile(filepath + exitFavouritesFile); + if (sf.exists()) { + sf.openBufferedRead(); + favourites = sf.readEntireFile().trim(); + sf.closeFile(); + } + } + + // Populate model + nooffavs = 0; + for (String s : hmNode.keySet()) { + ni = hmNode.get(s); + if (ni.isExit() && ni.isHttpSupported() && ni.getCountryCode().contentEquals(abbrv)) { + ni.setLatency(9999); + ni.setTestingMessage(LOCAL.getString("textfield_unknown")); + // Whitelisting here + ni.setFavouriteEnabled(favourites.contains(ni.getIPAddress())); + if (ni.isFavourite()) { + nooffavs++; + } + Object[] rowData = new Object[]{ni}; + entm.addRow(rowData); + } + } + } + + /** + * Get the number of active favourites + * + * @return number of favs as int + */ + public int getNumberOfFavs() { + return nooffavs; + } + + /** + * Ensures any threaded actions will terminate themselves + */ + public final void terminate() { + boolAbortActions = true; + } + + /** + * Save exit node whitelist + */ + public void saveExitFavourites() { + if (exitFavouritesFile == null) { + return; + } + SimpleFile sf = new SimpleFile(filepath + exitFavouritesFile); + sf.openBufferedWrite(); + NodeItem ni; + nooffavs = 0; + for (String s : hmNode.keySet()) { + ni = hmNode.get(s); + if (ni.isExit() && ni.isFavourite()) { + nooffavs++; + sf.writeFile(ni.getIPAddress(), 1); + } + } + sf.closeFile(); + } + + /** + * Save exit node blacklist + * + * @return number of active guards + */ + public int saveGuardWhitelist() { + int activeguards = 0; + if (guardFavouritesFile == null) { + return activeguards; + } + SimpleFile sf = new SimpleFile(filepath + guardFavouritesFile); + sf.openBufferedWrite(); + NodeItem ni; + for (String s : hmNode.keySet()) { + ni = hmNode.get(s); + if (ni.isGuard() && ni.isGuardEnabled()) { + sf.writeFile(ni.getFingerprint(), 1); + activeguards++; + } + } + sf.closeFile(); + return activeguards; + } + +} diff --git a/src/client/PacFactory.java b/src/client/PacFactory.java new file mode 100644 index 0000000..22d30ae --- /dev/null +++ b/src/client/PacFactory.java @@ -0,0 +1,721 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import java.io.File; +import java.util.ArrayList; +import java.util.Random; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Pattern; +import lib.OSFunction; +import lib.SimpleFile; + +/** + * + * @author Alistair Neil + */ +public class PacFactory { + + public static final String FILEUSER = "user"; + private static final String FILEEXT = ".txt"; + public static final int PROXY_DISABLED = 0; + public static final int PROXY_PATTERN = 1; + public static final int PROXY_ALL = 2; + private static final String PACFILE_EXT = ".pac"; + private static final String PATTERNFIRSTLINE = "### Pattern File, Do not remove or modify this line ###"; + private String strKDEProxyPrefsBackup; + private String strGnome3ProxyPrefsBackup; + private String strPACPath; + private String strBackupFolder; + private String strPatternsFolder; + private String strTempFolder; + private String strDefaultProxy = ""; + private String strDoNotProxy = ""; + private String strActiveCountry; + private String strActivePacName = ""; + private final Random randgen; + + public PacFactory() { + randgen = new Random(System.currentTimeMillis()); + } + + /** + * Get the active country code + * + * @return Active country + */ + public String getActiveCountry() { + return strActiveCountry; + } + + /** + * Create and/or activate a pacfile for a specific country + * + * @param isocountry + * @param port + */ + public void createPacFile(String isocountry, int port) { + + // Generate a pseudo random pac name + String pacname = createRandomName() + PACFILE_EXT; + savePACFile(pacname, getPacRules(isocountry, String.valueOf(port))); + setProxyAutoConfigURL("file://" + strPACPath.replace("\\", "/") + pacname); + strActiveCountry = isocountry; + if (!strActivePacName.isEmpty()) { + this.deletePAC(strActivePacName); + } + strActivePacName = pacname; + } + + /** + * Get pac rules for a specific country Can also be used for getting direct + * rule and proxy all rules, by setting countrycode to "direct" or + * "proxyall" + * + * @param countrycode + * @param port + * @return An arraylist of rules + */ + private ArrayList getPacRules(String country, String port) { + + ArrayList result = new ArrayList<>(); + // If country code is null then generate proxy all traffic rules + if (country.contentEquals("proxyall")) { + addSocksRule(result, "127.0.0.1", port); + return result; + } + if (country.contentEquals("direct")) { + addDirectMatchingRule(result, null); + return result; + } + + Pattern pat = Pattern.compile(","); + String[] split; + // Create our pattern rules storage list + ArrayList patternrules = new ArrayList<>(); + + // Add in do not proxy rules + if (!strDoNotProxy.isEmpty()) { + split = pat.split(strDoNotProxy); + for (String s : split) { + if (!s.isEmpty()) { + addDirectMatchingRule(result, "*" + s + "*"); + } + } + } + + // Get default patterns + loadPatternsList(country, patternrules); + for (String s : patternrules) { + split = pat.split(s); + if (split.length < 3) { + break; + } + if (split[2].contentEquals("true")) { + if (split[1].contentEquals("*")) { + addSocksRule(result, "127.0.0.1", port); + return result; + } else { + addSocksMatchingRule(result, split[1], "127.0.0.1", port); + } + } + } + if (strDefaultProxy.isEmpty()) { + addDirectMatchingRule(result, null); + } else { + addProxyRule(result, strDefaultProxy); + } + return result; + } + + /** + * + * @param rules + * @param proxy + */ + public void addProxyRule(ArrayList rules, String proxy) { + rules.add("\treturn \"PROXY " + proxy + "\";"); + } + + /** + * Add a socks rule to a supplied list + * + * @param rules + * @param host + * @param port + */ + public void addSocksRule(ArrayList rules, String host, String port) { + String rule = "\treturn \"SOCKS5 " + host + ":" + port + "\";"; + rules.add(rule); + } + + /** + * + * @param rules + * @param pattern + */ + public void addDirectMatchingRule(ArrayList rules, String pattern) { + String rule; + if (pattern == null) { + rule = "\treturn \"DIRECT\";"; + } else { + rule = "\tif (shExpMatch(url, \"" + pattern + "\"))\n" + + "\t{\n" + + "\t\treturn \"DIRECT\";\n" + + "\t}"; + + } + rules.add(rule); + } + + /** + * Add socks pattern mayching rule to a supllied list + * + * @param rules + * @param pattern + * @param host + * @param port + */ + public void addSocksMatchingRule(ArrayList rules, String pattern, String host, String port) { + String rule = "\tif (shExpMatch(url, \"" + pattern + "\"))\n" + + "\t{\n" + + "\t\treturn \"SOCKS5 " + host + ":" + port + "\";\n" + + "\t}"; + + rules.add(rule); + } + + /** + * Load a patterns list from a file + * + * @param country + * @param list + */ + public void loadPatternsList(String country, ArrayList list) { + String line; + int idxs, idxe; + SimpleFile sfPatternFile = new SimpleFile(strPatternsFolder + country.substring(0, 2) + "_" + FILEUSER + FILEEXT); + if (sfPatternFile.exists()) { + sfPatternFile.openBufferedRead(); + while ((line = sfPatternFile.readLine()) != null) { + idxs = line.indexOf('<'); + idxe = line.indexOf('>'); + if (idxs == 0 && idxe == (line.length() - 1)) { + list.add(line.substring(idxs + 1, idxe) + "," + FILEUSER); + } + } + sfPatternFile.closeFile(); + } + } + + /** + * Delete patterns file for a given country and type, where type is either + * "def" or "user" + * + * @param country + * @param type + */ + public void deletePatternsFile(String country, String type) { + SimpleFile sfPatternFile = new SimpleFile(strPatternsFolder + country.substring(0, 2) + "_" + type + FILEEXT); + sfPatternFile.delete(); + } + + /** + * Save a patterns list by filename + * + * @param country + * @param list + * @param type + */ + public void savePatternsList(String country, String type, ArrayList list) { + + SimpleFile sfPatternFile = new SimpleFile(strPatternsFolder + country.substring(0, 2) + "_" + type + FILEEXT); + sfPatternFile.openBufferedWrite(); + sfPatternFile.writeFile(PATTERNFIRSTLINE, 1); + for (String s : list) { + sfPatternFile.writeFile("<" + s + ">", 1); + } + sfPatternFile.closeFile(); + } + + /** + * Create folder in which pattern files will be stored + * + * @param folder + */ + public final void setPatternsFolder(String folder) { + strPatternsFolder = folder + SimpleFile.getSeparator(); + SimpleFile.createFolder(strPatternsFolder); + } + + /** + * Set folder where pac files will be generated + * + * @param folder + */ + public final void setPACFolder(String folder) { + strPACPath = folder; + SimpleFile.createFolder(folder); + } + + /** + * Set folder where system proxy settings will be backed up + * + * @param folder + */ + public final void setBackupFolder(String folder) { + strBackupFolder = folder + SimpleFile.getSeparator(); + SimpleFile.createFolder(strBackupFolder); + if (OSFunction.getGsettingsPath() != null) { + strGnome3ProxyPrefsBackup = strBackupFolder + "gnome3_proxy.txt"; + } else { + strGnome3ProxyPrefsBackup = null; + } + if (OSFunction.getKDEProxyPath() != null) { + strKDEProxyPrefsBackup = strBackupFolder + "kde_proxy.txt"; + } else { + strKDEProxyPrefsBackup = null; + } + } + + /** + * Set the temp folder for file extractions + * + * @param path + */ + public final void setTempFolder(String path) { + strTempFolder = path; + } + + /** + * Generic backup of proxy settings + * + */ + public void backupProxyPrefs() { + backupGnomeProxyPrefs(); + backupKDEProxyPrefs(); + } + + /** + * Gnome backup of proxy settings + * + */ + private void backupGnomeProxyPrefs() { + if (strBackupFolder == null) { + return; + } + SimpleFile sfProxyPrefs; + try { + if (strGnome3ProxyPrefsBackup != null) { + sfProxyPrefs = new SimpleFile(strGnome3ProxyPrefsBackup); + if (!sfProxyPrefs.exists()) { + sfProxyPrefs.openBufferedWrite(); + sfProxyPrefs.writeFile(OSFunction.getGnome3Pref("org.gnome.system.proxy", "mode"), 1); + sfProxyPrefs.writeFile(OSFunction.getGnome3Pref("org.gnome.system.proxy", "autoconfig-url"), 1); + sfProxyPrefs.closeFile(); + } + } + } catch (Exception ex) { + Logger.getGlobal().logp(Level.SEVERE, this.getClass().getName(), "backupGnomeProxyPrefs()", "", ex); + } + } + + /** + * KDE backup of proxy settings + * + */ + private void backupKDEProxyPrefs() { + if (strBackupFolder == null) { + return; + } + SimpleFile sfProxyPrefs; + try { + if (strKDEProxyPrefsBackup != null) { + sfProxyPrefs = new SimpleFile(strKDEProxyPrefsBackup); + if (!sfProxyPrefs.exists()) { + sfProxyPrefs.openBufferedWrite(); + sfProxyPrefs.writeFile(OSFunction.getKDEPref("Proxy Settings", "Proxy Config Script", ""), 1); + sfProxyPrefs.writeFile(OSFunction.getKDEPref("Proxy Settings", "ProxyType", "0"), 1); + sfProxyPrefs.closeFile(); + } + } + } catch (Exception ex) { + Logger.getGlobal().logp(Level.SEVERE, this.getClass().getName(), "backupKDEProxyPrefs()", "", ex); + } + } + + /** + * Generic restore of proxy settings, for ease of use + * + */ + public void restoreProxyPrefs(boolean resetonfail) { + restoreGnomeProxyPrefs(resetonfail); + restoreKDEProxyPrefs(resetonfail); + } + + /** + * Gnome specific restore of proxy settings + * + */ + private void restoreGnomeProxyPrefs(boolean resetonfail) { + + SimpleFile sfProxyPrefs; + + try { + // Restore gnome3 proxy prefs + if (strGnome3ProxyPrefsBackup != null) { + sfProxyPrefs = new SimpleFile(strGnome3ProxyPrefsBackup); + if (sfProxyPrefs.exists()) { + sfProxyPrefs.openBufferedRead(); + String mode = sfProxyPrefs.readLine(); + String url = sfProxyPrefs.readLine(); + sfProxyPrefs.closeFile(); + if (url != null && mode != null && !mode.isEmpty()) { + // Restore original settings from file + OSFunction.setGnome3Pref("org.gnome.system.proxy", "mode", mode); + OSFunction.setGnome3Pref("org.gnome.system.proxy", "autoconfig-url", url); + } + } else { + if (resetonfail) { + setGnomeProxyAutoConfigURL(null); + } + } + } + } catch (Exception ex) { + Logger.getGlobal().logp(Level.SEVERE, this.getClass().getName(), "restoreGnomeProxyPrefs()", "", ex); + } + } + + /** + * KDE specific restore of proxy settings + * + */ + private void restoreKDEProxyPrefs(boolean resetonfail) { + + SimpleFile sfProxyPrefs; + + try { + // Restore kde proxy prefs + if (strKDEProxyPrefsBackup != null) { + sfProxyPrefs = new SimpleFile(strKDEProxyPrefsBackup); + if (sfProxyPrefs.exists()) { + sfProxyPrefs.openBufferedRead(); + String url = sfProxyPrefs.readLine(); + String type = sfProxyPrefs.readLine(); + sfProxyPrefs.closeFile(); + if (url != null && type != null) { + if (!SimpleFile.exists(url)) { + url = ""; + } + OSFunction.setKDEPref("Proxy Settings", "Proxy Config Script", url); + OSFunction.setKDEPref("Proxy Settings", "ProxyType", type); + } + } else { + if (resetonfail) { + setKDEProxyAutoConfigURL(null); + } + } + } + } catch (Exception ex) { + Logger.getGlobal().logp(Level.SEVERE, this.getClass().getName(), "restoreKDEProxyPrefs()", "", ex); + } + } + + /** + * Generic proxy prefs delete, for ease of use + */ + public void deleteProxyPrefs() { + deleteGnomeProxyPrefs(); + deleteKDEProxyPrefs(); + } + + /** + * Generic delete of backed up gnome proxy settings + * + * @return boolean True if successful + */ + private boolean deleteGnomeProxyPrefs() { + + if (strBackupFolder == null) { + return false; + } + + boolean result = true; + + // Delete Gnome3 prefs + if (strGnome3ProxyPrefsBackup != null) { + result = SimpleFile.delete(strGnome3ProxyPrefsBackup); + } + return result; + } + + /** + * Generic delete of backed up KDE proxy settings + * + * @return boolean True if successful + */ + private boolean deleteKDEProxyPrefs() { + + if (strBackupFolder == null) { + return false; + } + + boolean result = true; + + // Delete Kde prefs + if (strKDEProxyPrefsBackup != null) { + result = SimpleFile.delete(strKDEProxyPrefsBackup); + } + return result; + } + + /** + * Generic set proxy config + * + * @param url + */ + public void setProxyAutoConfigURL(String url) { + setGnomeProxyAutoConfigURL(url); + setKDEProxyAutoConfigURL(url); + } + + /** + * Set Gnome proxy config + * + * @param url + */ + private void setGnomeProxyAutoConfigURL(String url) { + if (strGnome3ProxyPrefsBackup != null) { + if (url == null) { + OSFunction.resetGnome3Pref("org.gnome.system.proxy", "mode"); + OSFunction.resetGnome3Pref("org.gnome.system.proxy", "autoconfig-url"); + } else { + OSFunction.setGnome3Pref("org.gnome.system.proxy", "mode", "auto"); + OSFunction.setGnome3Pref("org.gnome.system.proxy", "autoconfig-url", url); + } + } + } + + /** + * Set KDE proxy config + * + * @param url + */ + private void setKDEProxyAutoConfigURL(String url) { + + if (strKDEProxyPrefsBackup != null) { + if (url == null) { + OSFunction.setKDEPref("Proxy Settings", "Proxy Config Script", ""); + OSFunction.setKDEPref("Proxy Settings", "ProxyType", 0); + } else { + OSFunction.setKDEPref("Proxy Settings", "Proxy Config Script", url); + OSFunction.setKDEPref("Proxy Settings", "ProxyType", 2); + } + } + } + + /** + * Save pac file using given filename + * + * @param filename + * @param ruleslist + */ + private void savePACFile(String filename, ArrayList ruleslist) { + SimpleFile sfPacFile = new SimpleFile(strPACPath + filename); + sfPacFile.openBufferedWrite(); + sfPacFile.writeFile("//" + filename, 1); + String temp = "function FindProxyForURL(url, host) {"; + sfPacFile.writeFile(temp, 1); + for (String s : ruleslist) { + sfPacFile.writeFile(s, 1); + } + sfPacFile.writeFile("}", 1); + sfPacFile.closeFile(); + } + + /** + * Delete specified pac file + * + * @param filename + * @return boolean true if action successful + */ + public boolean deletePAC(String filename) { + return SimpleFile.delete(strPACPath + filename); + } + + /** + * Delete all pac files + */ + public void deleteAllPAC() { + SimpleFile sf = new SimpleFile(strPACPath); + sf.setFileFilter(PACFILE_EXT); + sf.deleteFileList(sf.getFileList()); + } + + /** + * Get a pseudo random numerical name + * + * @return String + */ + private String createRandomName() { + // Create new filename with a random number to modify filename from + // previous one to force auto reload of pac settings in browser + int pacNumber = randgen.nextInt(); + if (pacNumber < 0) { + pacNumber = 0 - pacNumber; + } + return String.valueOf(pacNumber); + } + + /** + * Set default proxy url + * + * @param proxyurl + */ + public void setDefaultProxy(String proxyurl) { + strDefaultProxy = proxyurl; + } + + /** + * Set do not proxy + * + * @param hostcsv + */ + public void setDoNotProxy(String hostcsv) { + strDoNotProxy = hostcsv; + } + + /** + * Get value of comma separated host or ip list + * + * @return String value + */ + public String getDoNotProxy() { + return strDoNotProxy; + } + + /** + * Adds pattern to an existing pattern file + * + * @param country + * @param description + * @param pattern + */ + public void addToPatternFile(String country, String description, String pattern) { + if (strPatternsFolder == null || pattern.isEmpty()) { + return; + } + SimpleFile sfPatternFile = new SimpleFile(strPatternsFolder + SimpleFile.getSeparator() + country.substring(0, 2) + "_" + FILEUSER + FILEEXT); + sfPatternFile.openBufferedAppend(); + sfPatternFile.writeFile("<" + description + "," + pattern + ",true>", 1); + sfPatternFile.closeFile(); + } + + /** + * Get an array of user pattern files + * + * @return array of files + */ + public File[] getPatternsFiles() { + SimpleFile sf = new SimpleFile(strPatternsFolder); + sf.setFileFilter(FILEUSER + FILEEXT); + return sf.getFileList(); + } + + /** + * Export user patterns + * + * @param filename + * @param files + */ + public void exportUserPatterns(String filename, File[] files) { + + // Append .zip extension if we need to + if (!filename.endsWith(".zip")) { + filename += ".zip"; + } + // Add user pattern files to zip + SimpleFile sf = new SimpleFile(filename); + sf.openZipStream(9); + sf.addFilesToZip(files); + sf.closeZipStream(); + } + + /** + * Import patterns + * + * @param filename + * @return true if succesful + */ + public boolean importPatterns(String filename) { + + // Import patterns + boolean success = false; + SimpleFile sf = new SimpleFile(filename); + String destpath; + // Check existence + if (sf.exists()) { + // Get temporary path to extraction folder + if (strTempFolder == null) { + destpath = OSFunction.getTempFolder(null) + + getClass().getName(); + } else { + destpath = strTempFolder + getClass().getName(); + } + // Create temp extraction folder + SimpleFile.createFolder(destpath); + // Extract files to temp folder + success = sf.extractZipTo(destpath); + if (success) { + // Get list of files + sf.setFileName(destpath); + sf.setFileFilter(".txt"); + File[] files = sf.getFileList(); + // Verify each file before copying them over + String firstLine; + try { + if (files.length == 0) { + throw new Exception(); + } + for (File f : files) { + // Verify valid pattern file by checking first line of file + sf.setFile(f); + sf.openBufferedRead(); + firstLine = sf.readLine(); + sf.closeFile(); + if (firstLine != null) { + if (firstLine.toLowerCase().contains("pattern file")) { + SimpleFile.copyFromTo(f.getAbsolutePath(), strPatternsFolder + f.getName()); + } else { + success = false; + break; + } + } + } + } catch (Exception ex) { + success = false; + } + } + // Delete temporary files + SimpleFile.deleteFolder(destpath); + } + return success; + } + +} diff --git a/src/client/PatternsEditor.form b/src/client/PatternsEditor.form new file mode 100644 index 0000000..e1c3a1e --- /dev/null +++ b/src/client/PatternsEditor.form @@ -0,0 +1,202 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/client/PatternsEditor.java b/src/client/PatternsEditor.java new file mode 100644 index 0000000..327b15a --- /dev/null +++ b/src/client/PatternsEditor.java @@ -0,0 +1,602 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import lib.InfoDialog; +import java.awt.Component; +import java.awt.FontMetrics; +import java.awt.Frame; +import java.awt.event.ItemEvent; +import java.util.ArrayList; +import java.util.regex.Pattern; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JTable; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import lib.Localisation; + +/** + * + * @author Alistair Neil, + */ +public final class PatternsEditor extends javax.swing.JDialog { + + public static final int CANCEL = 0; + public static final int APPLY = 1; + private final PACTableModel pactm = new PACTableModel(); + private PacFactory pacFactory = null; + private String strChange = null; + private Frame parent = null; + private String strSelectedCountry = null; + private static final Localisation LOCAL = new Localisation("resources/MessagesBundle"); + + /** + * Creates a PatternsEditor dialog + * + * @param parent Parent frame + * @param modal Modality + * @param pacfactory PacFactory being edited + */ + public PatternsEditor(java.awt.Frame parent, boolean modal, PacFactory pacfactory) { + super(parent, modal); + this.parent = parent; + pacFactory = pacfactory; + initComponents(); + pactm.setColumnName(LOCAL.getString("patterntable_col1"), 0); + pactm.setColumnName(LOCAL.getString("patterntable_col2"), 1); + pactm.setColumnName(LOCAL.getString("patterntable_col3"), 2); + jTablePatterns.setModel(pactm); + jTablePatterns.setDefaultRenderer(String.class, new CustomTableCellRenderer()); + // Adjust our column widths + adjustTableColumnWidth(0, "AAAAAAAAAA"); + adjustTableColumnWidth(1, "AAAAAAAAAAAAAAAAAAAAAAAA"); + adjustTableColumnWidth(2, "AAA"); + jTablePatterns.setRowHeight(jLabel1.getHeight() + 1); + jTablePatterns.setShowGrid(true); + jTextDoNotProxy.setText(pacFactory.getDoNotProxy()); + } + + /** + * Populate the country combobox with a list of countries + * + * @param countries String[] of countries + */ + public void populateCountryComboBox(String[] countries) { + jComboCountry.setModel(new DefaultComboBoxModel<>(countries)); + jComboCountry.setSelectedIndex(-1); + } + + /** + * Set the selected country + * + * @param country + */ + public void setSelectedCountry(String country) { + jComboCountry.setSelectedItem(country); + } + + /** + * Populate the patterns table + * + * @param patterns an ArrayList of pattern rules + */ + private void populatePatternsTable(ArrayList patterns) { + + // Clear all entries from table + while (pactm.getRowCount() > 0) { + pactm.removeRow(0); + } + // If patterns null just return; + if (patterns == null) { + strChange = pactm.toString() + jTextDoNotProxy.getText(); + return; + } + + // Populate table + Pattern pat = Pattern.compile(","); + String[] split; + Object[] obj = new Object[3]; + for (String s : patterns) { + split = pat.split(s); + if (split.length < 4) { + continue; + } + obj[0] = split[0]; + obj[1] = split[1]; + try { + obj[2] = Boolean.valueOf(split[2]); + } catch (Exception ex) { + obj[2] = true; + } + pactm.addRow(obj, (split[3]).contains("user")); + } + strChange = pactm.toString() + jTextDoNotProxy.getText(); + } + + /** + * Test to see if patterns table has changed + * + * @return boolean True if changed + */ + private boolean isPatternsTableChanged() { + if (strChange == null) { + return false; + } + String temp = pactm.toString() + jTextDoNotProxy.getText(); + return (!temp.contentEquals(strChange)); + } + + /** + * Save patterns and rebuild active country pac if required + */ + private void savePatterns() { + String s; + Boolean b; + + ArrayList listUser = new ArrayList<>(); + int rowCount = pactm.getRowCount(); + if (rowCount > 0) { + for (int i = 0; i < rowCount; i++) { + s = pactm.getValueAt(i, 0) + "," + pactm.getValueAt(i, 1); + b = (Boolean) pactm.getValueAt(i, 2); + if (b) { + s += ",true"; + } else { + s += ",false"; + } + listUser.add(s); + } + } + + if (listUser.isEmpty()) { + pacFactory.deletePatternsFile(strSelectedCountry, PacFactory.FILEUSER); + } else { + pacFactory.savePatternsList(strSelectedCountry, PacFactory.FILEUSER, listUser); + } + pacFactory.setDoNotProxy(jTextDoNotProxy.getText()); + strChange = pactm.toString() + jTextDoNotProxy.getText(); + } + + /** + * This is a check to see if any pattern save are required before exiting + * the pattern editor + */ + private int saveOnExitCheck() { + int result = CANCEL; + if (jButtonSave.isEnabled()) { + jComboCountry.hidePopup(); + InfoDialog id = new InfoDialog(parent); + id.createWarn(LOCAL.getString("dlg_patterneditsave_title"), + LOCAL.getString("dlg_patterneditsave_body")); + id.setVisible(true); + strChange = null; + if (id.getReturnStatus() == InfoDialog.OK) { + savePatterns(); + result = APPLY; + } + jButtonSave.setEnabled(isPatternsTableChanged()); + } + return result; + } + + /** + * Will adjust table column widths based on fontmetrics + * + * @param col Column to be adjusted + * @param text Text string to adjust for + */ + private void adjustTableColumnWidth(int col, String text) { + FontMetrics ourFontMetrics = getFontMetrics(jTablePatterns.getTableHeader().getFont()); + jTablePatterns.getColumn(jTablePatterns.getColumnName(col)).setPreferredWidth(ourFontMetrics.stringWidth(text)); + } + + /** + * @return the return status of this dialog - one of RET_OK or RET_CANCEL + */ + public int getReturnStatus() { + return returnStatus; + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jButtonSave = new javax.swing.JButton(); + jButtonCancel = new javax.swing.JButton(); + jComboCountry = new javax.swing.JComboBox<>(); + jButtonDeletePattern = new javax.swing.JButton(); + jButtonAddPattern = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jScrollPane1 = new javax.swing.JScrollPane(); + jTablePatterns = new javax.swing.JTable(); + jLabel17 = new javax.swing.JLabel(); + jTextDoNotProxy = new javax.swing.JTextField(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Proxy Pattern Editor"); + setIconImage(null); + setResizable(false); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowClosing(java.awt.event.WindowEvent evt) { + closeDialog(evt); + } + }); + + jButtonSave.setText(LOCAL.getString("button_save")); // NOI18N + jButtonSave.setEnabled(false); + jButtonSave.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonSaveActionPerformed(evt); + } + }); + + jButtonCancel.setText(LOCAL.getString("button_close")); // NOI18N + jButtonCancel.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonCancelActionPerformed(evt); + } + }); + + jComboCountry.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); + jComboCountry.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jComboCountryItemStateChanged(evt); + } + }); + + jButtonDeletePattern.setText(LOCAL.getString("button_delete")); // NOI18N + jButtonDeletePattern.setEnabled(false); + jButtonDeletePattern.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonDeletePatternActionPerformed(evt); + } + }); + + jButtonAddPattern.setText(LOCAL.getString("button_addnew")); // NOI18N + jButtonAddPattern.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonAddPatternActionPerformed(evt); + } + }); + + jLabel1.setText(LOCAL.getString("label_editcountry")); // NOI18N + + jTablePatterns.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + + } + )); + jTablePatterns.setToolTipText(LOCAL.getString("ttip_patterntable")); // NOI18N + jTablePatterns.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_LAST_COLUMN); + jTablePatterns.setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + jTablePatterns.getTableHeader().setResizingAllowed(false); + jTablePatterns.getTableHeader().setReorderingAllowed(false); + jTablePatterns.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseReleased(java.awt.event.MouseEvent evt) { + jTablePatternsMouseReleased(evt); + } + }); + jTablePatterns.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + jTablePatternsKeyReleased(evt); + } + }); + jScrollPane1.setViewportView(jTablePatterns); + + jLabel17.setText(LOCAL.getString("label_donotproxy")); // NOI18N + + jTextDoNotProxy.setToolTipText(LOCAL.getString("ttip_donotproxy")); // NOI18N + jTextDoNotProxy.addFocusListener(new java.awt.event.FocusAdapter() { + public void focusLost(java.awt.event.FocusEvent evt) { + jTextDoNotProxyFocusLost(evt); + } + }); + jTextDoNotProxy.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + jTextDoNotProxyKeyReleased(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1) + .addGroup(layout.createSequentialGroup() + .addComponent(jComboCountry, javax.swing.GroupLayout.PREFERRED_SIZE, 264, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel1)) + .addGroup(layout.createSequentialGroup() + .addComponent(jButtonDeletePattern) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonAddPattern) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonCancel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonSave)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel17) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jTextDoNotProxy))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jComboCountry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jTextDoNotProxy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel17)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButtonDeletePattern) + .addComponent(jButtonCancel) + .addComponent(jButtonSave) + .addComponent(jButtonAddPattern)) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + + private void jButtonSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSaveActionPerformed + savePatterns(); + jButtonSave.setEnabled(isPatternsTableChanged()); + doClose(APPLY); + }//GEN-LAST:event_jButtonSaveActionPerformed + + private void jButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed + doClose(saveOnExitCheck()); + }//GEN-LAST:event_jButtonCancelActionPerformed + + /** + * Closes the dialog + */ + private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog + doClose(CANCEL); + }//GEN-LAST:event_closeDialog + +private void jComboCountryItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboCountryItemStateChanged + + if (evt.getStateChange() != ItemEvent.SELECTED) { + return; + } + + saveOnExitCheck(); + + // Check for no entries + if (jComboCountry.getItemCount() == 0) { + jTablePatterns.setEnabled(false); + jButtonDeletePattern.setEnabled(false); + jButtonAddPattern.setEnabled(false); + jButtonSave.setEnabled(false); + populatePatternsTable(null); + return; + } + + // We reach here if we have selected a valid country + jTablePatterns.setEnabled(true); + jButtonAddPattern.setEnabled(true); + strSelectedCountry = (String) jComboCountry.getSelectedItem(); + ArrayList patterns = new ArrayList<>(); + pacFactory.loadPatternsList(strSelectedCountry, patterns); + populatePatternsTable(patterns); +}//GEN-LAST:event_jComboCountryItemStateChanged + +private void jTablePatternsMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTablePatternsMouseReleased + jButtonDeletePattern.setEnabled(jTablePatterns.isCellEditable(jTablePatterns.getSelectedRow(), 0)); + jButtonSave.setEnabled(isPatternsTableChanged()); +}//GEN-LAST:event_jTablePatternsMouseReleased + +private void jButtonDeletePatternActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeletePatternActionPerformed + + int[] i; + while (true) { + i = jTablePatterns.getSelectedRows(); + if (i.length == 0) { + break; + } + pactm.removeRow(i[0]); + } + jButtonDeletePattern.setEnabled(false); + jButtonSave.setEnabled(isPatternsTableChanged()); +}//GEN-LAST:event_jButtonDeletePatternActionPerformed + +private void jTablePatternsKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTablePatternsKeyReleased + jButtonSave.setEnabled(isPatternsTableChanged()); +}//GEN-LAST:event_jTablePatternsKeyReleased + +private void jButtonAddPatternActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddPatternActionPerformed + + QuickAddDialog qad = new QuickAddDialog(parent, true); + qad.setTitle("Add new pattern"); + qad.setLocationRelativeTo(this); + qad.setVisible(true); + if (qad.getReturnStatus() == QuickAddDialog.CANCEL) { + return; + } + if (!qad.getPattern().isEmpty()) { + pactm.addRow(new Object[]{qad.getDescription(), qad.getPattern(), Boolean.TRUE}, true); + } + jButtonSave.setEnabled(isPatternsTableChanged()); +}//GEN-LAST:event_jButtonAddPatternActionPerformed + + private void jTextDoNotProxyKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextDoNotProxyKeyReleased + jButtonSave.setEnabled(isPatternsTableChanged()); + }//GEN-LAST:event_jTextDoNotProxyKeyReleased + + private void jTextDoNotProxyFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextDoNotProxyFocusLost + jButtonSave.setEnabled(isPatternsTableChanged()); + }//GEN-LAST:event_jTextDoNotProxyFocusLost + + private void doClose(int retStatus) { + returnStatus = retStatus; + setVisible(false); + dispose(); + } + + /** + * CustomTableCellRenderer + */ + public class CustomTableCellRenderer extends DefaultTableCellRenderer { + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, + boolean isSelected, boolean hasFocus, int row, int column) { + Component c = super.getTableCellRendererComponent(table, value, + isSelected, hasFocus, row, column); + + // Only for specific cell + if (table.isRowSelected(row)) { + return c; + } + if (column < 2) { + if (table.getModel().isCellEditable(row, column)) { + c.setBackground(javax.swing.UIManager.getDefaults().getColor("Table.background")); + } else { + c.setBackground(javax.swing.UIManager.getDefaults().getColor("control")); + } + } + return c; + } + } + + /** + * PACTableModel class + */ + public class PACTableModel extends DefaultTableModel { + + @SuppressWarnings("rawtypes") + private final String[] columnNames = {"Description", "Pattern", "Enabled"}; + private final Class[] types = new Class[]{ + java.lang.String.class, java.lang.String.class, java.lang.Boolean.class + }; + private final ArrayList rowedit = new ArrayList<>(); + + public void addRow(Object[] obj, boolean editable) { + addRow(obj); + rowedit.add(editable); + } + + /** + * Constructor + */ + public PACTableModel() { + } + + /** + * Get column count as integer + * + * @return columns as integer + */ + @Override + public int getColumnCount() { + return types.length; + } + + /** + * Get column class + * + * @param columnIndex + * @return object Class + */ + @Override + @SuppressWarnings("rawtypes") + public Class getColumnClass(int columnIndex) { + return types[columnIndex]; + } + + /** + * Test if cell at given row, col is editable + * + * @param row + * @param column + * @return True if editable + */ + @Override + public boolean isCellEditable(int row, int column) { + if (column == 2) { + return true; + } else { + return rowedit.get(row); + } + } + + /** + * Get column name at given index + * + * @param index + * @return name as string + */ + @Override + public String getColumnName(int index) { + return columnNames[index]; + } + + /** + * Set the column name at the specified index + * + * @param name + * @param index + */ + public void setColumnName(String name, int index) { + if (index < columnNames.length) { + columnNames[index] = name; + } + } + + /** + * Returns all data as a single string + * + * @return string + */ + @Override + public String toString() { + return getDataVector().toString(); + } + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButtonAddPattern; + private javax.swing.JButton jButtonCancel; + private javax.swing.JButton jButtonDeletePattern; + private javax.swing.JButton jButtonSave; + private javax.swing.JComboBox jComboCountry; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel17; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTable jTablePatterns; + private javax.swing.JTextField jTextDoNotProxy; + // End of variables declaration//GEN-END:variables + private int returnStatus = CANCEL; +} diff --git a/src/client/PrefsDialog.form b/src/client/PrefsDialog.form new file mode 100644 index 0000000..182e72f --- /dev/null +++ b/src/client/PrefsDialog.form @@ -0,0 +1,635 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/client/PrefsDialog.java b/src/client/PrefsDialog.java new file mode 100644 index 0000000..959aa13 --- /dev/null +++ b/src/client/PrefsDialog.java @@ -0,0 +1,608 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import javax.swing.DefaultComboBoxModel; +import lib.Localisation; +import lib.SimpleProps; +import lib.Utilities; + +/** + * + * @author Alistair Neil, + */ +public final class PrefsDialog extends javax.swing.JDialog { + + public static final int CANCEL = 0; + public static final int APPLY = 1; + public static final int RESET = 2; + + private static final Localisation LOCAL = new Localisation("resources/MessagesBundle"); + private final SimpleProps sp; + private final String disabledprefs; + + /** + * Creates a preferences editor dialog + * + * @param parent Parent Frame + * @param sp + * @param disabledprefs + */ + public PrefsDialog(java.awt.Frame parent, SimpleProps sp, String disabledprefs) { + super(parent, true); + this.sp = sp; + this.disabledprefs = disabledprefs; + initComponents(); + loadBasicPrefs(false); + loadAdvancedPrefs(false); + } + + /** + * @return the return status of this dialog - one of RET_OK or RET_CANCEL + */ + public int getReturnStatus() { + return returnStatus; + } + + public void loadBasicPrefs(boolean usedefault) { + + sp.setDefaultModeEnabled(usedefault); + jCheckAutostart.setSelected(sp.getBool("PREF_AUTOSTART")); + jCheckDisableTray.setSelected(sp.getBool("PREF_NOSYSTRAY")); + jCheckHideMin.setEnabled(!jCheckDisableTray.isSelected()); + jCheckHideTray.setSelected(sp.getBool("PREF_HIDETOTRAY")); + jCheckAppUpdate.setSelected(sp.getBool("PREF_UPDATECHECK")); + jCheckMinOnClose.setSelected(sp.getBool("PREF_MINONCLOSE")); + jCheckCacheDelete.setSelected(sp.getBool("PREF_CACHEDELETE")); + jCheckDisableNotify.setSelected(sp.getBool("PREF_DISABLE_NOTIFY")); + jCheckHideMin.setSelected(sp.getBool("PREF_HIDE_MIN")); + jCheckGeoUpdate.setSelected(sp.getBool("PREF_GEOCHECK")); + if (disabledprefs.contains("jCheckDisableTray")) { + jCheckDisableTray.setEnabled(false); + jCheckHideMin.setEnabled(false); + } + jCheckAppUpdate.setVisible(!disabledprefs.contains("jCheckAppUpdate")); + sp.setDefaultModeEnabled(false); + updatePortRanges(sp.getInt("PREF_TOR_TESTHREADS")); + } + + /** + * Load the preferences + * + * @param usedefault + */ + public void loadAdvancedPrefs(boolean usedefault) { + sp.setDefaultModeEnabled(usedefault); + jTextHTTPProxy.setText(sp.getString("PREF_HTTP_PROXY")); + jSpinnerMainPort.setValue(sp.getInt("PREF_LISTENPORT")); + jTextTorBridge.setText(sp.getString("PREF_TORBRIDGE")); + jTextTorArgs.setText(sp.getString("PREF_TORARGS")); + jComboLogLev.setSelectedIndex(sp.getInt("PREF_TORLOGLEV")); + jCheckSafeSocks.setSelected(sp.getBool("PREF_SAFESOCKS")); + jCheckTestSocks.setSelected(sp.getBool("PREF_TESTSOCKS")); + jCheckAvoidDisk.setSelected(sp.getBool("PREF_AVOIDDISK")); + jCheckSafeLog.setSelected(sp.getBool("PREF_SAFELOG")); + sp.setDefaultModeEnabled(false); + } + + /** + * Save preferences + */ + public void savePreferences() { + + sp.setInt("PREF_LISTENPORT", (Integer) jSpinnerMainPort.getValue()); + sp.setInt("PREF_TORLOGLEV", jComboLogLev.getSelectedIndex()); + sp.setBool("PREF_AUTOSTART", jCheckAutostart.isSelected()); + sp.setBool("PREF_NOSYSTRAY", jCheckDisableTray.isSelected()); + sp.setBool("PREF_HIDETOTRAY", jCheckHideTray.isSelected()); + sp.setBool("PREF_UPDATECHECK", jCheckAppUpdate.isSelected()); + sp.setBool("PREF_MINONCLOSE", jCheckMinOnClose.isSelected()); + sp.setBool("PREF_SAFESOCKS", jCheckSafeSocks.isSelected()); + sp.setBool("PREF_TESTSOCKS", jCheckTestSocks.isSelected()); + sp.setBool("PREF_AVOIDDISK", jCheckAvoidDisk.isSelected()); + sp.setBool("PREF_SAFELOG", jCheckSafeLog.isSelected()); + sp.setBool("PREF_CACHEDELETE", jCheckCacheDelete.isSelected()); + sp.setBool("PREF_DISABLE_NOTIFY", jCheckDisableNotify.isSelected()); + sp.setBool("PREF_HIDE_MIN", jCheckHideMin.isSelected()); + sp.setBool("PREF_GEOCHECK", jCheckGeoUpdate.isSelected()); + sp.setString("PREF_HTTP_PROXY", jTextHTTPProxy.getText()); + sp.setString("PREF_TORBRIDGE", jTextTorBridge.getText()); + sp.setString("PREF_TORARGS", jTextTorArgs.getText()); + } + + /** + * Update displayed port ranges to reflect any port changes + */ + private void updatePortRanges(int threads) { + int intBasePort = sp.getInt("PREF_LISTENPORT"); + String strRanges = LOCAL.getString("label_portranges"); + strRanges = strRanges.replace("$portmin", String.valueOf(intBasePort)); + strRanges = strRanges.replace("$portmax", String.valueOf(intBasePort + (threads * 2) + 1)); + jLabelPortRanges.setText(strRanges); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jTabPrefs = new javax.swing.JTabbedPane(); + jPanelBasicPrefs = new javax.swing.JPanel(); + jPanelGeneralPrefs = new javax.swing.JPanel(); + jCheckHideTray = new javax.swing.JCheckBox(); + jCheckAppUpdate = new javax.swing.JCheckBox(); + jCheckAutostart = new javax.swing.JCheckBox(); + jCheckDisableTray = new javax.swing.JCheckBox(); + jCheckMinOnClose = new javax.swing.JCheckBox(); + jCheckCacheDelete = new javax.swing.JCheckBox(); + jCheckDisableNotify = new javax.swing.JCheckBox(); + jCheckHideMin = new javax.swing.JCheckBox(); + jCheckGeoUpdate = new javax.swing.JCheckBox(); + jPanelAdvancedPrefs = new javax.swing.JPanel(); + jPanelTorPrefs = new javax.swing.JPanel(); + jLabel6 = new javax.swing.JLabel(); + jSpinnerMainPort = new javax.swing.JSpinner(); + jLabelPortRanges = new javax.swing.JLabel(); + jLabel11 = new javax.swing.JLabel(); + jTextTorBridge = new javax.swing.JTextField(); + jButtonGetBridges = new javax.swing.JButton(); + jCheckSafeSocks = new javax.swing.JCheckBox(); + jLabel12 = new javax.swing.JLabel(); + jCheckTestSocks = new javax.swing.JCheckBox(); + jLabel13 = new javax.swing.JLabel(); + jTextTorArgs = new javax.swing.JTextField(); + jLabel14 = new javax.swing.JLabel(); + jCheckAvoidDisk = new javax.swing.JCheckBox(); + jLabel15 = new javax.swing.JLabel(); + jComboLogLev = new javax.swing.JComboBox<>(); + jCheckSafeLog = new javax.swing.JCheckBox(); + jPanel1 = new javax.swing.JPanel(); + jLabel16 = new javax.swing.JLabel(); + jTextHTTPProxy = new javax.swing.JTextField(); + jButtonCancel = new javax.swing.JButton(); + jButtonApply = new javax.swing.JButton(); + jButtonDefaults = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setIconImage(null); + setResizable(false); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowClosing(java.awt.event.WindowEvent evt) { + closeDialog(evt); + } + }); + + jTabPrefs.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + jTabPrefsStateChanged(evt); + } + }); + + jPanelBasicPrefs.setFont(jPanelBasicPrefs.getFont().deriveFont(jPanelBasicPrefs.getFont().getStyle() | java.awt.Font.BOLD)); + + jPanelGeneralPrefs.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_general"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelBasicPrefs.getFont(), jPanelBasicPrefs.getForeground())); // NOI18N + + jCheckHideTray.setText(LOCAL.getString("chkbox_hidetotray")); // NOI18N + jCheckHideTray.setToolTipText(LOCAL.getString("ttip_hidetotray")); // NOI18N + + jCheckAppUpdate.setSelected(true); + jCheckAppUpdate.setText(LOCAL.getString("chkbox_checkforupdates")); // NOI18N + jCheckAppUpdate.setToolTipText(LOCAL.getString("ttip_checkforupdates")); // NOI18N + + jCheckAutostart.setText(LOCAL.getString("chkbox_autostart")); // NOI18N + jCheckAutostart.setToolTipText(LOCAL.getString("ttip_autostart")); // NOI18N + + jCheckDisableTray.setText(LOCAL.getString("chkbox_disabletray")); // NOI18N + jCheckDisableTray.setToolTipText(LOCAL.getString("ttip_disabletray")); // NOI18N + jCheckDisableTray.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jCheckDisableTrayItemStateChanged(evt); + } + }); + + jCheckMinOnClose.setText(LOCAL.getString("chkbox_minonclose")); // NOI18N + jCheckMinOnClose.setToolTipText(LOCAL.getString("ttip_minonclose")); // NOI18N + + jCheckCacheDelete.setText(LOCAL.getString("chkbox_securedelete")); // NOI18N + jCheckCacheDelete.setToolTipText(LOCAL.getString("ttip_securedelete")); // NOI18N + + jCheckDisableNotify.setText(LOCAL.getString("chkbox_disablenotify")); // NOI18N + jCheckDisableNotify.setToolTipText(LOCAL.getString("ttip_disablenotify")); // NOI18N + + jCheckHideMin.setText(LOCAL.getString("chkbox_hidemin")); // NOI18N + jCheckHideMin.setToolTipText(LOCAL.getString("ttip_hidemin")); // NOI18N + + jCheckGeoUpdate.setSelected(true); + jCheckGeoUpdate.setText(LOCAL.getString("chkbox_geocheck")); // NOI18N + jCheckGeoUpdate.setToolTipText(LOCAL.getString("ttip_geocheck")); // NOI18N + + javax.swing.GroupLayout jPanelGeneralPrefsLayout = new javax.swing.GroupLayout(jPanelGeneralPrefs); + jPanelGeneralPrefs.setLayout(jPanelGeneralPrefsLayout); + jPanelGeneralPrefsLayout.setHorizontalGroup( + jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelGeneralPrefsLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jCheckAutostart) + .addComponent(jCheckHideTray) + .addComponent(jCheckCacheDelete) + .addComponent(jCheckHideMin) + .addComponent(jCheckDisableNotify)) + .addGap(18, 18, 18) + .addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jCheckAppUpdate) + .addComponent(jCheckGeoUpdate) + .addComponent(jCheckDisableTray) + .addComponent(jCheckMinOnClose)) + .addContainerGap(39, Short.MAX_VALUE)) + ); + jPanelGeneralPrefsLayout.setVerticalGroup( + jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelGeneralPrefsLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jCheckAutostart) + .addComponent(jCheckGeoUpdate)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jCheckHideTray) + .addComponent(jCheckDisableTray)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jCheckHideMin) + .addComponent(jCheckMinOnClose)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelGeneralPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jCheckCacheDelete) + .addComponent(jCheckAppUpdate)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jCheckDisableNotify) + .addContainerGap(132, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout jPanelBasicPrefsLayout = new javax.swing.GroupLayout(jPanelBasicPrefs); + jPanelBasicPrefs.setLayout(jPanelBasicPrefsLayout); + jPanelBasicPrefsLayout.setHorizontalGroup( + jPanelBasicPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelBasicPrefsLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanelGeneralPrefs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanelBasicPrefsLayout.setVerticalGroup( + jPanelBasicPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelBasicPrefsLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanelGeneralPrefs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + + jTabPrefs.addTab(LOCAL.getString("tab_basic"), jPanelBasicPrefs); // NOI18N + + jPanelTorPrefs.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_torclientset"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelBasicPrefs.getFont(), jPanelBasicPrefs.getForeground())); // NOI18N + + jLabel6.setText(LOCAL.getString("label_listenport")); // NOI18N + + jSpinnerMainPort.setModel(new javax.swing.SpinnerNumberModel(9050, 9050, 9999, 1)); + jSpinnerMainPort.setToolTipText(LOCAL.getString("ttip_listenport")); // NOI18N + + jLabelPortRanges.setText("Currently active port ranges, 9052 to 9063"); + + jLabel11.setText(LOCAL.getString("label_bridgeaddress")); // NOI18N + + jTextTorBridge.setToolTipText(LOCAL.getString("ttip_bridgeaddress")); // NOI18N + + jButtonGetBridges.setText(LOCAL.getString("button_getbridges")); // NOI18N + jButtonGetBridges.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonGetBridgesActionPerformed(evt); + } + }); + + jCheckSafeSocks.setText(LOCAL.getString("chkbox_safesocks")); // NOI18N + jCheckSafeSocks.setToolTipText(LOCAL.getString("ttip_safesocks")); // NOI18N + + jLabel12.setText(LOCAL.getString("label_torlogging")); // NOI18N + + jCheckTestSocks.setText(LOCAL.getString("chkbox_testsocks")); // NOI18N + jCheckTestSocks.setToolTipText(LOCAL.getString("ttip_testsocks")); // NOI18N + + jLabel13.setText(LOCAL.getString("label_torargs")); // NOI18N + + jTextTorArgs.setToolTipText(LOCAL.getString("ttip_extraargs")); // NOI18N + + jLabel14.setText(LOCAL.getString("label_torsocks")); // NOI18N + + jCheckAvoidDisk.setText(LOCAL.getString("chkbox_diskavoid")); // NOI18N + jCheckAvoidDisk.setToolTipText(LOCAL.getString("ttip_avoiddisk")); // NOI18N + + jLabel15.setText(LOCAL.getString("label_diskoptions")); // NOI18N + + jComboLogLev.setModel(new DefaultComboBoxModel<>(new String[] {LOCAL.getString("combo_loglev1"),LOCAL.getString("combo_loglev2"),LOCAL.getString("combo_loglev3")})); + jComboLogLev.setToolTipText(LOCAL.getString("ttip_combo_loglevel")); // NOI18N + + jCheckSafeLog.setText(LOCAL.getString("chkbox_safelog")); // NOI18N + jCheckSafeLog.setToolTipText(LOCAL.getString("ttip_safelogging")); // NOI18N + + javax.swing.GroupLayout jPanelTorPrefsLayout = new javax.swing.GroupLayout(jPanelTorPrefs); + jPanelTorPrefs.setLayout(jPanelTorPrefsLayout); + jPanelTorPrefsLayout.setHorizontalGroup( + jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelTorPrefsLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel14) + .addComponent(jLabel15) + .addComponent(jLabel12) + .addComponent(jLabel13) + .addComponent(jLabel11) + .addComponent(jLabel6)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanelTorPrefsLayout.createSequentialGroup() + .addComponent(jCheckSafeSocks) + .addGap(18, 18, 18) + .addComponent(jCheckTestSocks)) + .addComponent(jCheckAvoidDisk) + .addGroup(jPanelTorPrefsLayout.createSequentialGroup() + .addComponent(jComboLogLev, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jCheckSafeLog)) + .addGroup(jPanelTorPrefsLayout.createSequentialGroup() + .addComponent(jTextTorBridge, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonGetBridges)) + .addGroup(jPanelTorPrefsLayout.createSequentialGroup() + .addComponent(jSpinnerMainPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabelPortRanges)) + .addComponent(jTextTorArgs)) + .addContainerGap()) + ); + jPanelTorPrefsLayout.setVerticalGroup( + jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelTorPrefsLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(jLabelPortRanges) + .addComponent(jSpinnerMainPort, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel6)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel11) + .addComponent(jTextTorBridge, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButtonGetBridges)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel14) + .addComponent(jCheckSafeSocks) + .addComponent(jCheckTestSocks)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel12) + .addComponent(jComboLogLev, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jCheckSafeLog)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel15) + .addComponent(jCheckAvoidDisk)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanelTorPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel13) + .addComponent(jTextTorArgs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + + jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_network"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelBasicPrefs.getFont(), jPanelBasicPrefs.getForeground())); // NOI18N + + jLabel16.setText(LOCAL.getString("label_defaultproxy")); // NOI18N + + jTextHTTPProxy.setToolTipText(LOCAL.getString("ttip_defaultproxy")); // NOI18N + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel16) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jTextHTTPProxy) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel16) + .addComponent(jTextHTTPProxy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + ); + + javax.swing.GroupLayout jPanelAdvancedPrefsLayout = new javax.swing.GroupLayout(jPanelAdvancedPrefs); + jPanelAdvancedPrefs.setLayout(jPanelAdvancedPrefsLayout); + jPanelAdvancedPrefsLayout.setHorizontalGroup( + jPanelAdvancedPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAdvancedPrefsLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelAdvancedPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanelTorPrefs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap()) + ); + jPanelAdvancedPrefsLayout.setVerticalGroup( + jPanelAdvancedPrefsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAdvancedPrefsLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanelTorPrefs, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + + jTabPrefs.addTab(LOCAL.getString("tab_advanced"), jPanelAdvancedPrefs); // NOI18N + + jButtonCancel.setText(LOCAL.getString("button_close")); // NOI18N + jButtonCancel.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonCancelActionPerformed(evt); + } + }); + + jButtonApply.setText(LOCAL.getString("button_apply")); // NOI18N + jButtonApply.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonApplyActionPerformed(evt); + } + }); + + jButtonDefaults.setText(LOCAL.getString("button_prefdefaults")); // NOI18N + jButtonDefaults.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonDefaultsActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jButtonDefaults) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonCancel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonApply) + .addContainerGap()) + .addComponent(jTabPrefs) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jTabPrefs) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButtonApply) + .addComponent(jButtonCancel) + .addComponent(jButtonDefaults)) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + + private void jButtonApplyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonApplyActionPerformed + savePreferences(); + updatePortRanges(sp.getInt("PREF_TOR_TESTHREADS")); + doClose(APPLY); + }//GEN-LAST:event_jButtonApplyActionPerformed + + private void jButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed + doClose(CANCEL); + }//GEN-LAST:event_jButtonCancelActionPerformed + + /** + * Closes the dialog + */ + private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog + doClose(CANCEL); + }//GEN-LAST:event_closeDialog + + private void jButtonGetBridgesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGetBridgesActionPerformed + Utilities.openFileExternally("https://bridges.torproject.org/bridges?lang=" + + LOCAL.toWebLanguageTag()); + }//GEN-LAST:event_jButtonGetBridgesActionPerformed + + private void jButtonDefaultsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDefaultsActionPerformed + switch (jTabPrefs.getSelectedIndex()) { + // Basic tab + case 0: + loadBasicPrefs(true); + break; + // Advanced tab + case 1: + loadAdvancedPrefs(true); + break; + } + }//GEN-LAST:event_jButtonDefaultsActionPerformed + + private void jTabPrefsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabPrefsStateChanged + switch (jTabPrefs.getSelectedIndex()) { + case 0: + jButtonDefaults.setToolTipText(LOCAL.getString("ttip_resetbasicprefs")); + break; + case 1: + jButtonDefaults.setToolTipText(LOCAL.getString("ttip_resetadvprefs")); + break; + } + }//GEN-LAST:event_jTabPrefsStateChanged + + private void jCheckDisableTrayItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckDisableTrayItemStateChanged + jCheckHideMin.setEnabled(!jCheckDisableTray.isSelected()); + }//GEN-LAST:event_jCheckDisableTrayItemStateChanged + + private void doClose(int retStatus) { + returnStatus = retStatus; + setVisible(false); + dispose(); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButtonApply; + private javax.swing.JButton jButtonCancel; + private javax.swing.JButton jButtonDefaults; + private javax.swing.JButton jButtonGetBridges; + private javax.swing.JCheckBox jCheckAppUpdate; + private javax.swing.JCheckBox jCheckAutostart; + private javax.swing.JCheckBox jCheckAvoidDisk; + private javax.swing.JCheckBox jCheckCacheDelete; + private javax.swing.JCheckBox jCheckDisableNotify; + private javax.swing.JCheckBox jCheckDisableTray; + private javax.swing.JCheckBox jCheckGeoUpdate; + private javax.swing.JCheckBox jCheckHideMin; + private javax.swing.JCheckBox jCheckHideTray; + private javax.swing.JCheckBox jCheckMinOnClose; + private javax.swing.JCheckBox jCheckSafeLog; + private javax.swing.JCheckBox jCheckSafeSocks; + private javax.swing.JCheckBox jCheckTestSocks; + private javax.swing.JComboBox jComboLogLev; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel15; + private javax.swing.JLabel jLabel16; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabelPortRanges; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanelAdvancedPrefs; + private javax.swing.JPanel jPanelBasicPrefs; + private javax.swing.JPanel jPanelGeneralPrefs; + private javax.swing.JPanel jPanelTorPrefs; + private javax.swing.JSpinner jSpinnerMainPort; + private javax.swing.JTabbedPane jTabPrefs; + private javax.swing.JTextField jTextHTTPProxy; + private javax.swing.JTextField jTextTorArgs; + private javax.swing.JTextField jTextTorBridge; + // End of variables declaration//GEN-END:variables + private int returnStatus = CANCEL; +} diff --git a/src/client/QuickAddDialog.form b/src/client/QuickAddDialog.form new file mode 100644 index 0000000..956f2e8 --- /dev/null +++ b/src/client/QuickAddDialog.form @@ -0,0 +1,138 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/client/QuickAddDialog.java b/src/client/QuickAddDialog.java new file mode 100644 index 0000000..91e693f --- /dev/null +++ b/src/client/QuickAddDialog.java @@ -0,0 +1,214 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import lib.Localisation; + +/** + * + * @author Alistair Neil, + */ +public final class QuickAddDialog extends javax.swing.JDialog { + + private static final Localisation LOCAL = new Localisation("resources/MessagesBundle"); + public static final int CANCEL = 0; + public static final int APPLY = 1; + public static final int RESET = 2; + + /** + * Creates a quick add patterns dialog + * + * @param parent parent frame + * @param modal modality + */ + public QuickAddDialog(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + /** + * Set text that appears on the Apply button + * + * @param text + */ + public void setApplyText(String text) { + jButtonApply.setText(text); + } + + /** + * Set the test that appears in both fields + * + * @param desc + * @param pattern + */ + public void setFields(String desc, String pattern) { + jTextDescription.setText(desc); + jTextPattern.setText(pattern); + } + + /** + * Get contents of description field + * + * @return String text + */ + public String getDescription() { + return jTextDescription.getText(); + } + + /** + * Get contents of the pattern field + * + * @return String text + */ + public String getPattern() { + return jTextPattern.getText(); + } + + /** + * @return the return status of this dialog - one of RET_OK or RET_CANCEL + */ + public int getReturnStatus() { + return returnStatus; + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jPanelPreferences = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + jTextDescription = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + jTextPattern = new javax.swing.JTextField(); + jButtonCancel = new javax.swing.JButton(); + jButtonApply = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle(LOCAL.getString("dlg_quickadd_title")); // NOI18N + setIconImage(null); + setResizable(false); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowClosing(java.awt.event.WindowEvent evt) { + closeDialog(evt); + } + }); + + jPanelPreferences.setFont(jPanelPreferences.getFont().deriveFont(jPanelPreferences.getFont().getStyle() | java.awt.Font.BOLD)); + + jLabel1.setText(LOCAL.getString("label_quickadd_desc")); // NOI18N + + jLabel2.setText(LOCAL.getString("label_quickadd_pattern")); // NOI18N + + jButtonCancel.setText(LOCAL.getString("button_cancel")); // NOI18N + jButtonCancel.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonCancelActionPerformed(evt); + } + }); + + jButtonApply.setText(LOCAL.getString("button_addnew")); // NOI18N + jButtonApply.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonApplyActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanelPreferencesLayout = new javax.swing.GroupLayout(jPanelPreferences); + jPanelPreferences.setLayout(jPanelPreferencesLayout); + jPanelPreferencesLayout.setHorizontalGroup( + jPanelPreferencesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelPreferencesLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelPreferencesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1) + .addComponent(jTextDescription, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE) + .addComponent(jLabel2) + .addComponent(jTextPattern, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelPreferencesLayout.createSequentialGroup() + .addComponent(jButtonCancel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonApply))) + .addContainerGap()) + ); + jPanelPreferencesLayout.setVerticalGroup( + jPanelPreferencesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelPreferencesLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addGap(0, 0, 0) + .addComponent(jTextDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel2) + .addGap(0, 0, 0) + .addComponent(jTextPattern, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelPreferencesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButtonApply) + .addComponent(jButtonCancel)) + .addContainerGap()) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanelPreferences, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanelPreferences, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + ); + + pack(); + }// //GEN-END:initComponents + + private void jButtonApplyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonApplyActionPerformed + doClose(APPLY); + }//GEN-LAST:event_jButtonApplyActionPerformed + + private void jButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed + doClose(CANCEL); + }//GEN-LAST:event_jButtonCancelActionPerformed + + /** + * Closes the dialog + */ + private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog + doClose(CANCEL); + }//GEN-LAST:event_closeDialog + + private void doClose(int retStatus) { + returnStatus = retStatus; + setVisible(false); + dispose(); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButtonApply; + private javax.swing.JButton jButtonCancel; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JPanel jPanelPreferences; + private javax.swing.JTextField jTextDescription; + private javax.swing.JTextField jTextPattern; + // End of variables declaration//GEN-END:variables + private int returnStatus = CANCEL; +} diff --git a/src/client/SelekTOR.form b/src/client/SelekTOR.form new file mode 100644 index 0000000..b4343a1 --- /dev/null +++ b/src/client/SelekTOR.form @@ -0,0 +1,1018 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/client/SelekTOR.java b/src/client/SelekTOR.java new file mode 100644 index 0000000..6537f8a --- /dev/null +++ b/src/client/SelekTOR.java @@ -0,0 +1,3595 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import java.awt.Color; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ItemEvent; +import java.awt.event.MouseEvent; +import java.io.File; +import java.io.IOException; +import java.net.Socket; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Random; +import java.util.logging.FileHandler; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.logging.SimpleFormatter; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JFileChooser; +import javax.swing.JPopupMenu; +import javax.swing.JProgressBar; +import javax.swing.SwingUtilities; +import javax.swing.Timer; +import javax.swing.event.TableModelEvent; +import javax.swing.table.TableRowSorter; +import lib.AboutDialog; +import lib.DesktopNotify; +import lib.ExtensionFileFilter; +import lib.GTKFixes; +import lib.InfoDialog; +import lib.TextResourceDialog; +import lib.Localisation; +import lib.NetFunctions; +import lib.OSFunction; +import lib.SimpleFile; +import lib.SimpleProps; +import lib.SwingTrayIcon; +import lib.TrayPopupMenu; +import lib.Utilities; + +/** + * + * @author Alistair Neil + */ +public class SelekTOR extends javax.swing.JFrame { + + private static final Localisation LOCAL = new Localisation("resources/MessagesBundle"); + private static final String EMPTYSTR = ""; + private static final String PREFSVER = "1.01"; + private static final String APPNAME = "SelekTOR"; + private static final String APPVER = "3.13.73"; + private static final String APPSERIES = "3xx"; + private static final String WEBDOMAIN = "www.dazzleships.net"; + private static final String FILEDOMAIN = "http://dazzle.000webhostapp.com"; + private static final String HOMEPAGE = "http://" + WEBDOMAIN; + private static final String HOMEPAGE_SSL = "https://" + WEBDOMAIN; + private static final String CONTACT = HOMEPAGE_SSL + "/?page_id=247"; + private static final String APPUPDATE = FILEDOMAIN + "/anapps/linux/selektor/"; + private static final String TESTURL = "http://google.com"; + private static final String TORPROJECT = "https://torproject.org/"; + private static final String TORCHECK = "https://check.torproject.org/"; + private static final String ATLAS = "https://atlas.torproject.org/"; + private static final String PATREON = "https://www.patreon.com/SelekTOR"; + private static final String DOCSPATH = "/usr/share/doc/selektor/"; + private static final String EXITFAVOURITES = "favourites.txt"; + private static final String GUARDWHITELIST = "guardwhitelist.txt"; + private static final String GEOIPZIP = "geoip.zip"; + private static final String GEOIPSHA = "geoip.sha"; + private static final String ICONFILE = "selektor.png"; + private static final int TESTING_DISABLED = 0; + private static final int TESTING_ACTIVE = -1; + private static final long MAXTHRESHOLD = 5000; + private String torExe; + private String dataDirectory; + private String clientLocation; + private String settingsPath; + private String cachePath; + private String defaultGeoipPath; + private String geoipPath; + private String geoip6Path; + private String iconPath = EMPTYSTR; + private TorController tcMain; + private NodeList nodeList; + private PacFactory pacFactory; + private String strExitISOCode = "GB"; + private String strRequestedExit = EMPTYSTR; + private NodeItem niActiveGuard; + private NodeItem niActiveMiddle; + private NodeItem niActiveExit; + private int intRowSelected = -1; + private ExitNodeTableModel entm; + private SimpleProps sp; + private final ArrayList alTestThreads = new ArrayList<>(); + private int intActiveNodeTests = 0; + private int intBestNodeIndex = 0; + private String[] strArrBestNodes; + private long lngThreshold = MAXTHRESHOLD; + private int intThresholdExceeded = 0; + private NetFunctions nf; + private boolean boolNetEnabled = true; + private String strSecret; + private String strRawSecret; + private String strHash; + private String strDNSHost = "127.0.0.1"; + private String strDNSPort = "9053"; + private String strHTTPHost = "127.0.0.1"; + private String strHTTPPort; + private String strSocksHost = "127.0.0.1"; + private String strSocksPort = "9050"; + private String strExitNodes = "{FI}"; + private String strExcludeNodes; + private final ArrayList alTestQueue = new ArrayList<>(); + private Timer tmr; + private int intBeginTesting; + private int intLatencyCheck = 0; + private int intAutoSelectCheck; + private long lngHibernateTimeStamp; + private volatile boolean boolFirstRun; + private ArrayList alArgs; + private TorMonFrame tmf; + private long startupDelay; + private DesktopNotify dn; + private SwingTrayIcon sti; + private String desktopname = EMPTYSTR; + private String compositor = EMPTYSTR; + private boolean updateCheckDisabled; + private int intTimeoutSocketMsec = 8000; + private int intTimeoutStartupDelayMsec = 2000; + private int iLatencyCheck = 0; // 4950 + /** + * Initialises SelekTOR UI Frame + * + * @param args + */ + public SelekTOR(String[] args) { + + boolFirstRun = true; + + // Initialises UI theme to system default + Utilities.loadUIStyle("System"); + + // Check for multiple instances of this app + if (false && OSFunction.isMultipleInstance(APPNAME)) { + openInstanceDialog(); + cleanupExit(); + return; + } + + // Initialise some essentialvariables + // I know this looks a bit odd but trust me this allows us to install and run from anywhere + String runPath = OSFunction.getUsersCurrentFolder() + OSFunction.getFileSeparator(); + if (runPath.startsWith("/usr/share")) { + runPath = "/usr/share/"; + } + iconPath = runPath + "icons" + OSFunction.getFileSeparator(); + settingsPath = OSFunction.getAppSettingsPath(APPNAME, APPSERIES); + cachePath = settingsPath + "cache" + OSFunction.getFileSeparator(); + + // Initialise property settings + initProperties(); + + // Initialise pac factory + initPacFactory(); + + // Get the desktop + desktopname = OSFunction.getActiveDesktop(); + compositor = OSFunction.getCompositor(); + + // Process any supplied cli arguments + if (processCLIArgs(args)) { + cleanupExit(); + return; + } + // Ensure any old proxy settings are cleaned up + pacCleanup(); + + // Verify Tor client is installed + if (torExe != null) { + clientLocation = torExe; + } else if (OSFunction.isWindows()) { + clientLocation = OSFunction.findFile("tor.exe", "Tor/"); + } else { + clientLocation = OSFunction.findFile("tor", "/usr/sbin/", "/usr/bin/"); + } + if (clientLocation == null) { + Logger.getGlobal().log(Level.SEVERE, "Tor executable not found."); + openTorClientDialog(); + cleanupExit(); + return; + } + + // Verify if geoip data is installed + defaultGeoipPath = "/usr/share/tor/"; + geoipPath = OSFunction.findFile("geoip", settingsPath, defaultGeoipPath); + geoip6Path = OSFunction.findFile("geoip6", settingsPath, defaultGeoipPath); + if (geoipPath == null || geoip6Path == null) { + Logger.getGlobal().log(Level.SEVERE, "Geoip not found."); + openTorClientDialog(); + cleanupExit(); + return; + } + + // Verify if gsettings is installed + if (OSFunction.getGsettingsPath() == null) { + Logger.getGlobal().log(Level.SEVERE, "Gsettings not found."); + openGsettingsDialog(); + cleanupExit(); + return; + } + + // Netbeans components init + initComponents(); + Utilities.preloadFileChooser(); + updateProgramStatus(LOCAL.getString("progstatus_initial")); + + // Process any startup delay + try { + Thread.sleep(startupDelay); + } catch (InterruptedException ex) { + } + startupDelay = -1; + + // Backup proxy preferences + pacFactory.backupProxyPrefs(); + pacFactory.setProxyAutoConfigURL(null); + + // Initialise node table + initNodeTables(); + + // Initialise tor main and test threads + initTorMain(); + + // Do a Tor version check + float torversion = tcMain.getVersion(); + Logger.getGlobal().logp(Level.INFO, this.getClass().getName(), "", "Tor version = " + torversion); + if (torversion < 0.2420) { + openToOldDialog(); + cleanupExit(); + return; + } + + // Create testing threads + initTestThreads(sp.getInt("PREF_TOR_TESTHREADS")); + + // Final Initialisation of other components which need to be done last + initFinalComponents(); + + // System tray + initSystemTray(); + + // Main program timer + initTimer(); + + // Do tor main start + applyMainTorSettings(); + tcMain.setStartupDelay(1000); + tcMain.start(); + + initGUIVisibility(); + Logger.getGlobal().log(Level.INFO, "Environment = {0}", System.getenv().toString()); + Logger.getGlobal().log(Level.INFO, "Active desktop = {0}", desktopname); + Logger.getGlobal().log(Level.INFO, "Compositor = {0}", compositor); + if (Logger.getGlobal().isLoggable(Level.FINE)) { + for (String s : OSFunction.getCachedProcesses()) { + Logger.getGlobal().log(Level.FINE, "Process = {0}", s); + } + } + } + + /** + * Initialise properties + */ + private void initProperties() { + + // Initialise application title + setTitle(APPNAME); + // Application icon + setIconImage(new javax.swing.ImageIcon(iconPath + ICONFILE).getImage()); + + // Initial logging settings + Logger.getGlobal().setLevel(Level.SEVERE); + addLoggingFile(settingsPath + "status.log", false); + + // Init properties + sp = new SimpleProps(settingsPath + APPNAME + ".xml", APPNAME + " Settings"); + // Set up our defaults + sp.setDefaultModeEnabled(true); + sp.setString("PREF_ISOCOUNTRY", "DK"); + //? int + sp.setInt("PREF_LISTENPORT", Integer.parseInt(strSocksPort)); + sp.setInt("PREF_TOR_TESTHREADS", 2); + sp.setInt("PREF_TORLOGLEV", 2); + sp.setInt("PREF_PROXY_MODE", 2); + sp.setLong("PREF_GEODATE", 0); + sp.setBool("PREF_GEOCHECK", true); + sp.setBool("PREF_AUTOSTART", false); + sp.setBool("PREF_NOSYSTRAY", false); + sp.setBool("PREF_HIDETOTRAY", false); + sp.setBool("PREF_MINONCLOSE", false); + sp.setBool("PREF_HIDE_MIN", false); + sp.setBool("PREF_UPDATECHECK", true); + sp.setBool("PREF_SAFESOCKS", false); + sp.setBool("PREF_TESTSOCKS", false); + sp.setBool("PREF_AVOIDDISK", true); + sp.setBool("PREF_SAFELOG", false); + sp.setBool("PREF_CACHEDELETE", false); + sp.setBool("PREF_DISABLE_NOTIFY", false); + sp.setString("PREF_HTTP_PROXY", EMPTYSTR); + sp.setString("PREF_DONOT_PROXY", "localhost,127.0.0.1"); + sp.setString("PREF_TORBRIDGE", EMPTYSTR); + sp.setString("PREF_TORARGS", EMPTYSTR); + sp.setDefaultModeEnabled(false); + sp.resetToDefaults(); + sp.load(); + // This will reset the preferences file to its default if we dont get a preferences version match + if (!sp.getString("prefsver").contentEquals(PREFSVER)) { + sp.resetToDefaults(); + sp.setString("prefsver", PREFSVER); + sp.delete(); + sp.save(); + } else { + sp.save(); + } + // Dont allow listen ports below 9050, prevents any conflicts with the Tor default service. + // Which can be used along side SelekTOR + /* + if (sp.getInt("PREF_LISTENPORT") < 9050) { + sp.setInt("PREF_LISTENPORT", 9050); + sp.save(); + } + */ + strExitISOCode = sp.getString("PREF_ISOCOUNTRY"); + } + + /** + * Initialise logging facilities + * + * @param logpath + * @param append + */ + private void addLoggingFile(String logpath, boolean append) { + try { + if (logpath != null) { + FileHandler fh = new FileHandler(logpath, 10000000, 1, append); + fh.setFormatter(new SimpleFormatter()); + Logger.getGlobal().addHandler(fh); + } + } catch (SecurityException | IOException ex) { + } + } + + /** + * Processes any supplied arguments post UI component build + * + * @param args Startup arguments + */ + private boolean processCLIArgs(String... args) { + alArgs = new ArrayList<>(); + alArgs.addAll(Arrays.asList(args)); + for (String s : args) { + if (s.contentEquals("--tor-exe")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + torExe = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--data-directory")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + dataDirectory = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--raw-secret")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + strRawSecret = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--socks-port")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + strSocksPort = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--socks-host")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + strSocksHost = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--dns-port")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + strDNSPort = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--dns-host")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + strDNSHost = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--http-port")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + strHTTPPort = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--http-host")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + strHTTPHost = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--exclude-nodes")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + strExcludeNodes = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--exit-nodes")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + strExitNodes = alArgs.get(0); + alArgs.remove(0); + } + } + if (s.contentEquals("--start-delay")) { + alArgs.remove(s); + if (alArgs.size() > 0) { + String strDelay = alArgs.get(0); + try { + startupDelay = Long.valueOf(strDelay) * 1000; + alArgs.remove(0); + } catch (NumberFormatException ex) { + } + } + } + if (s.contentEquals("--debug-all")) { + alArgs.remove(s); + if (!alArgs.isEmpty()) { + addLoggingFile(alArgs.get(0), false); + alArgs.remove(0); + } + Logger.getGlobal().setLevel(Level.ALL); + } + if (s.contentEquals("--debug-warn")) { + alArgs.remove(s); + if (!alArgs.isEmpty()) { + addLoggingFile(alArgs.get(0), false); + alArgs.remove(0); + } + Logger.getGlobal().setLevel(Level.WARNING); + } + if (s.contentEquals("--debug-info")) { + alArgs.remove(s); + if (!alArgs.isEmpty()) { + addLoggingFile(alArgs.get(0), false); + } + Logger.getGlobal().setLevel(Level.INFO); + } + if (s.contentEquals("--debug-fine")) { + alArgs.remove(s); + if (!alArgs.isEmpty()) { + addLoggingFile(alArgs.get(0), false); + alArgs.remove(0); + } + Logger.getGlobal().setLevel(Level.FINE); + } + if (s.contentEquals("--debug-finer")) { + alArgs.remove(s); + if (!alArgs.isEmpty()) { + addLoggingFile(alArgs.get(0), false); + alArgs.remove(0); + } + Logger.getGlobal().setLevel(Level.FINER); + } + if (s.contentEquals("--debug-finest")) { + alArgs.remove(s); + if (!alArgs.isEmpty()) { + addLoggingFile(alArgs.get(0), false); + alArgs.remove(0); + } + Logger.getGlobal().setLevel(Level.FINEST); + } + if (s.contentEquals("--reset-defaults")) { + alArgs.remove(s); + sp.resetToDefaults(); + sp.save(); + sp.load(); + return true; + } + if (s.contentEquals("--clear-cache")) { + alArgs.remove(s); + SimpleFile.deleteFolder(cachePath); + } + if (s.contentEquals("--help")) { + alArgs.remove(s); + outputHelp(); + // Disable proxy restore on exit + pacFactory = null; + return true; + } + if (s.contentEquals("--cleanup")) { + alArgs.remove(s); + if (!sp.getBool("PREF_AUTOSTART")) { + return true; + } + } + if (s.contentEquals("--default-proxy-quiet")) { + alArgs.remove(s); + pacFactory.setProxyAutoConfigURL(null); + pacFactory.deleteProxyPrefs(); + // Disable proxy restore on exit + pacFactory = null; + return true; + } + if (s.contentEquals("--restore-proxy-quiet")) { + alArgs.remove(s); + return true; + } + if (s.contentEquals("--update-disable")) { + alArgs.remove(s); + updateCheckDisabled = true; + } + if (s.contentEquals("--restore-proxy")) { + alArgs.remove(s); + InfoDialog id = createInfoDialog(); + id.createWarn(LOCAL.getString("dlg_restoreproxy_title"), + LOCAL.getString("dlg_restoreproxy_body")); + id.pack(); + id.setVisible(true); + if (id.getReturnStatus() == InfoDialog.OK) { + return true; + } + // Disable proxy restore on exit + pacFactory = null; + return true; + } + if (s.contentEquals("--default-proxy")) { + alArgs.remove(s); + InfoDialog id = createInfoDialog(); + id.createWarn(LOCAL.getString("dlg_resetproxy_title"), + LOCAL.getString("dlg_resetproxy_body")); + id.pack(); + id.setVisible(true); + if (id.getReturnStatus() == InfoDialog.OK) { + pacFactory.setProxyAutoConfigURL(null); + pacFactory.deleteProxyPrefs(); + } + // Disable proxy restore on exit + pacFactory = null; + return true; + } + if (s.contentEquals("--ignore-desktop")) { + alArgs.remove(s); + desktopname = EMPTYSTR; + } + } + if (alArgs.size() > 0) { + outputHelp(); + // Disable proxy restore on exit + pacFactory = null; + return true; + } + return false; + } + + /** + * Output on standard out command line help info + */ + private void outputHelp() { + System.out.println(APPNAME + " " + APPVER + " valid command line arguments."); + System.out.println(); + System.out.println("--help : This help information"); + System.out.println("--tor-exe : full path of the tor executable"); + //d + System.out.println("--raw-secret: raw secret for ocntroller"); + System.out.println("--dns-port : DNSPort e.g. 9053"); + System.out.println("--socks-port : SocksPort e.g. 9054"); + System.out.println("--http-port : HTTPPort e.g. 9128"); + System.out.println("--dns-host : DNSHost e.g. 9053"); + System.out.println("--socks-host : SocksHost e.g. 9054"); + System.out.println("--http-host : HTTPHost e.g. 9128"); + System.out.println("--debug-all [filename] : All debug output."); + System.out.println("--debug-warn [filename] : Warnings level debug output."); + System.out.println("--debug-info [filename] : Information level debug output."); + System.out.println("--debug-fine [filename] : Fine level debug output."); + System.out.println("--debug-finer [filename] : Finer level debug output."); + System.out.println("--debug-finest [filename] : Finest level debug output."); + System.out.println("--reset-defaults : Return user settings to their safe defaults."); + System.out.println("--clear-cache : Clears the Tor cache on startup."); + System.out.println("--ignore-desktop : Ignore desktop detection information."); + System.out.println("--start-delay : Delay startup in seconds, eg. --start-delay 5"); + System.out.println("--cleanup : Cleans up after a bad shutdown which may have left system proxy in an unknown state."); + System.out.println("--default-proxy-quiet : Set system proxy back to its defaults quietly, without GUI dialog."); + System.out.println("--restore-proxy-quiet : Attempt to restore proxy to its last known settings using a previously saved backup, " + + "without GUI dialog."); + System.out.println("--default-proxy : Set system proxy back to its defaults accepts verification input via a GUI dialog.."); + System.out.println("--restore-proxy : Attempt to restore proxy to its last known settings using a previously saved backup, " + + "with input verification via a GUI dialog."); + System.out.println("--update-disable : Disables the version update checking at startup and removes " + + "the option from preferences."); + System.out.println(); + } + + /** + * Sets the enabled status of various GUI objects + * + * @param enabled + */ + private void setComponentsEnabled(boolean enabled) { + jButtonExitNodeDetails.setEnabled(enabled); + jButtonMiddleNodeDetails.setEnabled(enabled); + jButtonGuardNodeDetails.setEnabled(enabled); + jButtonSetGuards.setEnabled(enabled); + jMenuItemPatternEdit.setEnabled(enabled); + jMenuItemAddPattern.setEnabled(enabled); + jTableExitNodes.setEnabled(enabled); + jComboCountry.setEnabled(enabled); + jMenuItemTorCheck.setEnabled(enabled); + jCheckProxyDisable.setEnabled(enabled); + jCheckProxyByPattern.setEnabled(enabled); + jCheckProxyAll.setEnabled(enabled); + jCheckTrayProxyDisable.setEnabled(enabled); + jCheckTrayProxyByPattern.setEnabled(enabled); + jCheckTrayProxyAll.setEnabled(enabled); + jButtonClearFavs.setEnabled(enabled); + if (!enabled) { + jMenuItemGeoip.setEnabled(enabled); + } + } + + /** + * Final initialisation of objects that need to be done near the end of + * startup + * + */ + private void initFinalComponents() { + + // Apply fixes for linux gtk issues in java + GTKFixes.fixMenubarHeight(jMenuBar, jMenuItemGUI); + GTKFixes.fixMenuSelectionColor(jMenuMenu, jMenuProxy, jMenuHelp); + GTKFixes.fixJMenuPopupBorder(jMenuMenu, jMenuProxy, jMenuHelp); + GTKFixes.fixMenuItemFgColor(jCheckProxyDisable, jCheckProxyByPattern, jCheckProxyAll); + GTKFixes.fixMenuItemFgColor(jCheckTrayProxyDisable, jCheckTrayProxyByPattern, jCheckTrayProxyAll); + + // Disable certain components until first node is activated + setComponentsEnabled(false); + + // Add proxy buttons to proxy button groups + buttonGroupProxy.add(jCheckProxyDisable); + buttonGroupProxy.add(jCheckProxyByPattern); + buttonGroupProxy.add(jCheckProxyAll); + buttonGroupProxyTray.add(jCheckTrayProxyDisable); + buttonGroupProxyTray.add(jCheckTrayProxyByPattern); + buttonGroupProxyTray.add(jCheckTrayProxyAll); + + // Update initial proxy selection + switch (sp.getInt("PREF_PROXY_MODE")) { + case 0: + jCheckProxyDisable.setSelected(true); + break; + case 1: + jCheckProxyByPattern.setSelected(true); + break; + case 2: + jCheckProxyAll.setSelected(true); + break; + } + + // Make debug log menu item visible if required + jMenuItemDebugLog.setVisible(Logger.getGlobal().getLevel() != Level.SEVERE); + + } + + /** + * Initialise our internal 1 second timer tick + * + */ + private void initTimer() { + tmr = new Timer(1000, new java.awt.event.ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + try { + // Do a hibernate check, check to see if computer has been asleep for more than 60 secs + if ((System.currentTimeMillis() - lngHibernateTimeStamp) > 60000) { + Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(), + "initTimer()", "Hibernate Recovery"); + lngHibernateTimeStamp = System.currentTimeMillis(); + setComponentsEnabled(false); + stopAllTorThreads(); + boolFirstRun = true; + tcMain.start(); + } + lngHibernateTimeStamp = System.currentTimeMillis(); + + if (!boolNetEnabled) { + return; + } + + // Do Latency checking + if (intLatencyCheck > 0 && iLatencyCheck > 0) { + intLatencyCheck--; + if (intLatencyCheck == 0) { + intLatencyCheck = 5; + getFreshNodeInfo(); + // Tor latency check, only when node active + if (niActiveExit != null) { + // Do latency check + tcMain.doLatencyCheck(iLatencyCheck); + } + } + } + + // Activate a node selection check + if (intAutoSelectCheck > 0) { + intAutoSelectCheck--; + if (intAutoSelectCheck == 0) { + autoSelectNode(); + } + } + + // Activate a testing cycle + if (intBeginTesting > 0) { + intBeginTesting--; + if (intBeginTesting == 0) { + runTestingCycle(); + } + } + } catch (Exception ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "initTimer() actionPerformed", EMPTYSTR, ex); + } + } + }); + lngHibernateTimeStamp = System.currentTimeMillis(); + tmr.setInitialDelay(0); + tmr.setRepeats(true); + tmr.start(); + + } + + /** + * Initialise our pacfactory object + * + */ + private void initPacFactory() { + pacFactory = new PacFactory(); + pacFactory.setTempFolder(cachePath); + pacFactory.setBackupFolder(settingsPath + "backup"); + pacFactory.setPatternsFolder(settingsPath + "patterns"); + pacFactory.setPACFolder(settingsPath); + pacFactory.setDefaultProxy(sp.getString("PREF_HTTP_PROXY")); + pacFactory.setDoNotProxy(sp.getString("PREF_DONOT_PROXY")); + } + + /** + * Open the preferences dialog + */ + private void openPreferencesDialog() { + + // open dialog + PrefsDialog pd; + String disableditems = EMPTYSTR; + if (!sti.isSupported()) { + sp.setBool("PREF_NOSYSTRAY", true); + disableditems += "jCheckDisableTray"; + } + if (updateCheckDisabled) { + disableditems += ",jCheckAppUpdate"; + } + pd = new PrefsDialog(this, sp, disableditems); + pd.setTitle(LOCAL.getString("wintitle_prefs").replace("$appname", APPNAME)); + pd.pack(); + pd.setLocationRelativeTo(this); + pd.setVisible(true); + + // Check for changes + String changed = sp.getChangedProperties(); + if (pd.getReturnStatus() == PrefsDialog.APPLY) { + sp.save(); + } + + if (changed.contains("PREF_HTTP_PROXY")) { + pacFactory.setDefaultProxy(sp.getString("PREF_HTTP_PROXY")); + rebuildPatternPac(); + } + + if (changed.contains("PREF_NOSYSTRAY")) { + if (sp.getBool("PREF_NOSYSTRAY")) { + sti.unload(); + } else { + sti.load(); + } + } + + if (changed.contains("PREF_DISABLE_NOTIFY")) { + dn.setEnabled(!sp.getBool("PREF_DISABLE_NOTIFY")); + if (dn.isEnabled() && !dn.isSupported()) { + openLibnotifyDialog(); + } + } + + if (!boolNetEnabled) { + return; + } + + // Check to see if bridges entry was changed + if (changed.contains("TORBRIDGE")) { + // Update status message + updateProgramStatus(LOCAL.getString("progstatus_applychanges")); + // Validate bridge entry + if (!tcMain.validateBridges(sp.getString("PREF_TORBRIDGE"))) { + // Validation failed + sp.setString("PREF_TORBRIDGE", EMPTYSTR); + sp.save(); + // Apply default bridge settings by doing hard Tor restart + stopAllTorThreads(); + applyMainTorSettings(); + tcMain.start(); + // Indicate validation failure to user + openBridgeErrorDialog(); + } else { + // Apply default bridge settings by doing hard Tor restart + stopAllTorThreads(); + applyMainTorSettings(); + tcMain.start(); + } + return; + } + + // Check for any parameters that have changed that require full restart + if (changed.contains("LISTENPORT") || changed.contains("SAFE") + || changed.contains("AVOID") + || changed.contains("LOGLEV") || changed.contains("TORARGS") + || changed.contains("TESTSOCKS")) { + // Update status message + updateProgramStatus(LOCAL.getString("progstatus_applychanges")); + // Apply default bridge settings by doing hard Tor restart + stopAllTorThreads(); + applyMainTorSettings(); + tcMain.start(); + } + } + + private void applyMainTorSettings() { + + // Check to see if bridges are active + String bridge = sp.getString("PREF_TORBRIDGE"); + if (!tcMain.validateBridges(bridge)) { + bridge = EMPTYSTR; + sp.setString("PREF_TORBRIDGE", bridge); + sp.save(); + } + // Update entry node label on UI + if (bridge.isEmpty()) { + jLabelGuard.setText(LOCAL.getString("label_guardnode")); + } else { + jLabelGuard.setText(LOCAL.getString("label_bridgenode")); + } + + tcMain.setBridges(bridge); + tcMain.setTestingURL(TESTURL); + tcMain.setListenPort(sp.getInt("PREF_LISTENPORT")); + tcMain.setEntryNodes(nodeList.getGuardFavouritesAsCSV()); + tcMain.setBoolTorOption("SafeSocks", sp.getBool("PREF_SAFESOCKS")); + tcMain.setBoolTorOption("TestSocks", sp.getBool("PREF_TESTSOCKS")); + tcMain.setBoolTorOption("AvoidDiskWrites", sp.getBool("PREF_AVOIDDISK")); + tcMain.setBoolTorOption("SafeLogging", sp.getBool("PREF_SAFELOG")); + tcMain.setExternalArgs(sp.getString("PREF_TORARGS")); + tcMain.setLogLevel(sp.getInt("PREF_TORLOGLEV")); + tcMain.setGeoIP4(geoipPath); + tcMain.setGeoIP6(geoip6Path); + tmf.setLaunchString("# Via commandline\n" + + tcMain.getCLIOptionsAsString() + "\n\n" + + "# Via torrc configuration file\n" + + tcMain.getTorrcOptionsAsString() + ); + } + + /** + * Abort actions on all tor client threads + */ + private void abortAllTorThreads() { + if (niActiveExit != null) { + niActiveExit.setCircuitHops(null); + } + if (tcMain != null) { + tcMain.abortActions(); + } + abortTesting(); + } + + /** + * Bring all tor threads to a stop + */ + private void stopAllTorThreads() { + abortTesting(); + stopTestClients(); + if (nodeList != null) { + nodeList.terminate(); + } + if (tcMain != null) { + tcMain.stop(); + tcMain.clearStdout(); + tcMain.setStartupDelay(intTimeoutStartupDelayMsec); + } + } + + /** + * Do nodelist refresh + */ + private void regenNodelist() { + Thread t = new Thread(new java.lang.Runnable() { + + @Override + public void run() { + if (boolFirstRun) { + updateProgramStatus(LOCAL.getString("progstatus_generate")); + nodeList.refreshNodelist(tcMain); + // App update check + checkForAppUpdates(); + } + switch (nodeList.getCurrentStatus()) { + case NodeList.NODELIST_BUILT: + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + if (boolFirstRun) { + dn.setNotificationBody(LOCAL.getString("traymenu_proxymode" + (sp.getInt("PREF_PROXY_MODE") + 1))); + applyProxyChanges(sp.getInt("PREF_PROXY_MODE")); + } + // Update countries combo box + String[] countries = nodeList.getValidatedCountries(); + DefaultComboBoxModel dcbm = new DefaultComboBoxModel<>(countries); + jComboCountry.setModel(dcbm); + jComboCountry.setSelectedIndex(-1); + String strSelection = strExitISOCode + "," + LOCAL.getDisplayCountry(strExitISOCode); + // Check selection exists + if (dcbm.getIndexOf(strSelection) < 0) { + // Does not exist so default to the first country entry + jComboCountry.setSelectedIndex(0); + } else { + jComboCountry.setSelectedItem(strSelection); + } + // Check to make shure we have enough guard nodes + int activeguards = nodeList.saveGuardWhitelist(); + if (activeguards < 3 && activeguards > 0) { + openNotEnoughGuardsDialog(); + } + } + }); + break; + case NodeList.NODELIST_FAILED: + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + Logger.getGlobal().logp(Level.WARNING, SelekTOR.class + .getName(), "fetchRemoteData()", "Nodelist Failed"); + openFatalErrorDialog(LOCAL.getString("dlg_nodelistfail_body")); + cleanupExit(); + } + }); + break; + } + + } + }); + t.start(); + } + + /** + * Check remoteversion to determine if their is a newer application + * available + * + */ + private void checkForAppUpdates() { + + // App update + if (!sp.getBool("PREF_UPDATECHECK") || updateCheckDisabled) { + Logger.getGlobal().log(Level.WARNING, "Update check is disabled."); + return; + } + TorCircuit tc = tcMain.getLatestCircuit(); + if (tc != null) { + String finger = tc.getExit(TorCircuit.FINGER); + NodeItem ni = nodeList.getNode(finger); + if (ni != null) { + Logger.getGlobal().log(Level.INFO, "Active Exit is {0}({1}) in {2}", + new Object[]{ni.getNickName(), finger, ni.getCountryName()}); + } + } + String url = APPUPDATE + "version.html"; + Socket s = tcMain.createTorSocketToURL(url, false); + nf.setSocketTimeout(intTimeoutSocketMsec); + String version = nf.getURLContentAsString(url, s); + if (version == null) { + Logger.getGlobal().log(Level.WARNING, "Failed to retrieve version info."); + return; + } + Logger.getGlobal().log(Level.INFO, "Sucessfully retrieved version info."); + final String remoteversion = version.trim(); + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + if (Utilities.isNewerVersion(APPVER, remoteversion)) { + InfoDialog id = createInfoDialog(); + id.createInfo(LOCAL.getString("dlg_update_title"), + LOCAL.getString("dlg_update_body").replace("$version", remoteversion)); + id.setAutoClose(30000); + id.pack(); + id.setVisible(true); + } + } + }); + } + + /** + * Check to see if we need to update geoip + * + */ + private void updateGeoipCheck() { + jMenuItemGeoip.setEnabled(true); + if (!sp.getBool("PREF_GEOCHECK")) { + return; + } + long lngDate = sp.getLong("PREF_GEODATE"); + if (System.currentTimeMillis() > lngDate) { + updateGeoip(); + } + + } + + /** + * Pops up the GEOIP update dialog + */ + private void updateGeoip() { + + InfoDialog id = new InfoDialog(this) { + + private final InfoDialog id = this; + + @Override + public void progressTask(int retstatus, final JProgressBar jpb) { + Thread t = new Thread(new java.lang.Runnable() { + + @Override + public void run() { + String url = APPUPDATE + GEOIPSHA; + String destfile = OSFunction.getTempFolder(EMPTYSTR) + APPNAME + + "_" + GEOIPZIP; + try { + setAckEnabled(false); + jpb.setString(LOCAL.getString("dload_status_contact")); + Socket s; + // Grab checksum file from dazzleships + if (isCheckBoxSelected()) { + if (niActiveExit == null) { + // Indicate download failure + Logger.getGlobal().log(Level.INFO, "Invalid exit node"); + throw new IOException(); + } + if (niActiveExit.getLatency() > 4000) { + // Indicate download failure + Logger.getGlobal().log(Level.INFO, "Poor exit node"); + throw new IOException(); + } + s = tcMain.createTorSocketToURL(url, false); + } else { + s = new Socket(FILEDOMAIN, 80); + } + nf.setSocketTimeout(intTimeoutSocketMsec); + nf.setProgressBar(jpb); + jpb.setStringPainted(true); + if (!id.isVisible()) { + throw new IOException(); + } + Logger.getGlobal().log(Level.INFO, "Starting geoip.sha download"); + String chksum = nf.getURLContentAsString(url, s); + if (chksum == null || chksum.isEmpty()) { + // Indicate download failure + Logger.getGlobal().log(Level.INFO, "geoip.sha download failed"); + throw new IOException(); + } + // Grab geodata zip file from dazzleships + if (!id.isVisible()) { + throw new IOException(); + } + Logger.getGlobal().log(Level.INFO, "Starting geoip.zip download"); + url = APPUPDATE + GEOIPZIP; + if (isCheckBoxSelected()) { + s = tcMain.createTorSocketToURL(url, false); + } else { + s = new Socket(FILEDOMAIN, 80); + } + final SimpleFile sf = new SimpleFile(destfile); + // Delete old/previous file + if (sf.exists()) { + sf.delete(); + } + // Ensure zip file downloaded + nf.saveURLContentToFile(destfile, url, s, true); + if (!sf.exists()) { + // Indicate download failure + Logger.getGlobal().log(Level.INFO, "geoip.zip download failed"); + throw new IOException(); + } + // Do checksum verification + String fchk = Utilities.getSha1Sum(destfile); + if (!fchk.contentEquals(chksum.trim())) { + // Delete corrupt zip file + sf.delete(); + // Indicate download failure + Logger.getGlobal().log(Level.INFO, "geoip.zip checksum does not match"); + throw new IOException(); + } + if (!id.isVisible()) { + throw new IOException(); + } + if (sf.extractZipTo(settingsPath)) { + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + // Set new check time + updateGeoipCheckDate(); + // Update geoip paths + geoipPath = OSFunction.findFile("geoip", settingsPath, defaultGeoipPath); + geoip6Path = OSFunction.findFile("geoip6", settingsPath, defaultGeoipPath); + // Restart Tor client, to take advantage of new geoip + jComboCountry.setEnabled(false); + setComponentsEnabled(false); + boolFirstRun = true; + stopAllTorThreads(); + applyMainTorSettings(); + tcMain.start(); + setVisible(false); + dispose(); + } + }); + } + } catch (final Exception ex) { + // Exits here in case of download fail + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + Logger.getGlobal().log(Level.WARNING, ex.getMessage()); + jpb.setString(LOCAL.getString("dload_status_failed")); + setAckEnabled(true); + } + }); + } + } + }); + if (retstatus == InfoDialog.OK) { + t.start(); + } else { + updateGeoipCheckDate(); + setVisible(false); + dispose(); + } + + } + }; + id.setTitle(APPNAME); + id.setCancelButtonText(LOCAL.getString("button_cancel")); + id.setContinueButtonText(LOCAL.getString("button_continue")); + id.setCloseButtonText(LOCAL.getString("button_close")); + id.setCheckBoxText(LOCAL.getString("chkbox_viator")); + id.setCheckBoxVisible(true); + id.setCheckBoxEnabled(true); + id.pack(); + id.createProgress(LOCAL.getString("dlg_geo_title"), + LOCAL.getString("dlg_geo_body")); + id.pack(); + id.setVisible(true); + } + + private void updateGeoipCheckDate() { + // Set new check time + sp.setLong("PREF_GEODATE", System.currentTimeMillis() + ((long) 60000 * 60 * 24 * 90)); + if (strRawSecret == null ) { strRawSecret = Utilities.generateSecretKey(16); } + + sp.setString("PREF_SECRET", strRawSecret); + sp.save(); + } + + /** + * System tray initialisation + */ + private void initSystemTray() { + + // Initialise tray utility + sti = new SwingTrayIcon(this.getGraphicsConfiguration(), "resources/trayicon.png"); + if (desktopname.contentEquals("gnome3") + || desktopname.contentEquals("enlightenment") + || desktopname.contentEquals("kde5")) { + sti.disable(); + } + + // Initialise desktop notification + dn = new DesktopNotify(sti, iconPath + ICONFILE); + dn.setNotificationTitle(APPNAME); + dn.setEnabled(!sp.getBool("PREF_DISABLE_NOTIFY")); + if (dn.isEnabled() && !dn.isSupported()) { + openLibnotifyDialog(); + } + + // If trayIcon valid add mouse listener + TrayPopupMenu tpm = new TrayPopupMenu(); + GTKFixes.fixTrayMenuPopupBorder(tpm); + tpm.add(jCheckTrayProxyDisable); + tpm.add(jCheckTrayProxyByPattern); + tpm.add(jCheckTrayProxyAll); + tpm.add(new JPopupMenu.Separator()); + tpm.add(jMenuItemGUI); + tpm.add(jMenuItemQuitx); + sti.addMouseListener(new javax.swing.event.MouseInputListener() { + + @Override + public void mouseClicked(MouseEvent e) { + } + + @Override + public void mousePressed(MouseEvent e) { + } + + @Override + public void mouseReleased(MouseEvent e) { + if (e.getButton() == MouseEvent.BUTTON1) { + toggleGUIVisibility(); + } + } + + @Override + public void mouseEntered(MouseEvent e) { + } + + @Override + public void mouseExited(MouseEvent e) { + } + + @Override + public void mouseDragged(MouseEvent e) { + } + + @Override + public void mouseMoved(MouseEvent e) { + } + }); + sti.setTrayPopupMenu(tpm); + if (!sp.getBool("PREF_NOSYSTRAY")) { + sti.load(); + } + } + + private InfoDialog createInfoDialog() { + InfoDialog id = new InfoDialog(this); + id.setTitle(APPNAME); + id.setCancelButtonText(LOCAL.getString("button_cancel")); + id.setContinueButtonText(LOCAL.getString("button_continue")); + id.setCloseButtonText(LOCAL.getString("button_close")); + return id; + } + + private void openInstanceDialog() { + InfoDialog id = createInfoDialog(); + id.createError(LOCAL.getString("dlg_instancefail_title"), + LOCAL.getString("dlg_instancefail_body").replace("$appname", APPNAME)); + id.pack(); + id.setVisible(true); + } + + private void openNotEnoughGuardsDialog() { + InfoDialog id = createInfoDialog(); + id.createWarn(LOCAL.getString("dlg_guardwarn_title"), + LOCAL.getString("dlg_notenoughguards_body").replace("$appname", APPNAME)); + id.setCancelVisible(false); + id.setContinueButtonText(LOCAL.getString("button_setguards")); + id.pack(); + id.setVisible(true); + if (id.getReturnStatus() == InfoDialog.OK) { + openGuardsSettingDialog(); + } + } + + private void openGsettingsDialog() { + InfoDialog id = createInfoDialog(); + id.createError(LOCAL.getString("dlg_gsetting_title"), + LOCAL.getString("dlg_gsetting_body").replace("$appname", APPNAME)); + id.pack(); + id.setVisible(true); + } + + private void openTorClientDialog() { + InfoDialog id = createInfoDialog(); + id.createError(LOCAL.getString("dlg_torclient_title"), + LOCAL.getString("dlg_torclient_body").replace("$appname", APPNAME)); + id.pack(); + id.setVisible(true); + } + + private void openLibnotifyDialog() { + InfoDialog id = createInfoDialog(); + id.createError(LOCAL.getString("dlg_libnotify_title"), + LOCAL.getString("dlg_libnotify_body").replace("$appname", APPNAME)); + id.setModal(false); + id.setAutoClose(10000); + id.pack(); + id.setVisible(true); + } + + private void openBridgeErrorDialog() { + InfoDialog id = createInfoDialog(); + id.createError(LOCAL.getString("dlg_bridgerr_title"), + LOCAL.getString("dlg_bridgerr_body").replace("$appname", APPNAME)); + id.pack(); + id.setVisible(true); + } + + /** + * Node table and node list initialisation + */ + private void initNodeTables() { + // Create our node list storage object + nodeList = new NodeList(settingsPath, EXITFAVOURITES, GUARDWHITELIST); + entm = new ExitNodeTableModel(); + entm.setColumnName(LOCAL.getString("exittable_col1"), 0); + entm.setColumnName(LOCAL.getString("exittable_col2"), 1); + entm.setColumnName(LOCAL.getString("exittable_col3"), 2); + entm.setColumnName(LOCAL.getString("exittable_col4"), 3); + entm.setColumnName(LOCAL.getString("exittable_col5"), 4); + entm.addTableModelListener(new javax.swing.event.TableModelListener() { + @Override + public void tableChanged(TableModelEvent e) { + if (e.getType() == TableModelEvent.UPDATE) { + if (e.getColumn() == 4) { + nodeList.saveExitFavourites(); + // Force favourites recalc + intThresholdExceeded = 255; + // Do node auto selection in 5 secs + intAutoSelectCheck = 5; + } + } + } + }); + nodeList.setExitNodeTableModel(entm); + jTableExitNodes.setModel(entm); + // Adjust table column widths + adjustExitTableColumns(); + } + + private void clearFavourites() { + for (int i = 0; i < entm.getRowCount(); i++) { + entm.setValueAt(false, i, 4); + } + } + + /** + * Main tor process initialisation + */ + private void initTorMain() { + + intBeginTesting = TESTING_DISABLED; + nf = new NetFunctions(); + tmf = new TorMonFrame(); + tmf.setTitle(LOCAL.getString("wintitle_tormonitor")); + tmf.setIconImage(new javax.swing.ImageIcon(iconPath + ICONFILE).getImage()); + + // Initialise the Tor main client event handler + tcMain = new TorController(clientLocation, cachePath) { + private int intNodeFailCount; + + @Override + public void controllerEventFired(int event, Object data) { + Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(), + "controllerEventFired() on Port=" + getListenPort(), + getEventMessage(event) + ", Data=" + data); + switch (event) { + case TOR_BRIDGE: + nodeList.addBridge((String) data); + break; + case TOR_NOROUTE: + if (boolNetEnabled) { + boolNetEnabled = false; + boolFirstRun = true; + updateProgramStatus(LOCAL.getString("progstatus_nonet")); + dn.setNotificationBody(LOCAL.getString("progstatus_nonet")); + dn.raiseNotification(); + setComponentsEnabled(false); + } + break; + case TOR_DIRINFO_STALE: + // Deliberate fallthrough here + case TOR_NOEXITS: + // Ensure client is fully running as multiple TOR_NOEXITS can + // be generated at startup especially if folks are torrenting via Tor + if (getStatus() < STATUS_IDLE) { + break; + } + updateProgramStatus(LOCAL.getString("circuit_status_none")); + intNodeFailCount = 0; + resetBestNode(); + strRequestedExit = getBestNode(); + if (strRequestedExit == null) { + strRequestedExit = EMPTYSTR; + } + stop(); + setSilentBootEnabled(true); + setStartupDelay(intTimeoutStartupDelayMsec); + start(TOR_RESTARTED); + break; + case TOR_CLOCK_ERROR: + // Deliberate fallthrough here + case TOR_BOOT_FATAL: + Logger.getGlobal().logp(Level.SEVERE, SelekTOR.class.getName(), + "controllerEventFired() on Port=" + getListenPort(), getEventMessage(event) + ", Data=" + data); + openFatalErrorDialog((String) data); + cleanupExit(); + break; + case TOR_BOOT_TIMEOUT: + stop(); + setStartupDelay(intTimeoutStartupDelayMsec); + start(TOR_BOOTED); + break; + case TOR_MESSAGE: + updateProgramStatus((String) data); + break; + case TOR_BOOTED: + boolNetEnabled = true; + regenNodelist(); + break; + case TOR_RESTARTED: + boolNetEnabled = true; + activateNode(strRequestedExit); + break; + case EVENT_CIRCUIT_FAILED: + // Deliberate fallthrough here + case EVENT_CIRCUITS_FAILED: + switch (++intNodeFailCount) { + case 1: + // Retry + updateProgramStatus(LOCAL.getString("progstatus_nodefailretry")); + intThresholdExceeded = 254; + intAutoSelectCheck = 2; + break; + case 2: + // Get the next best node + updateProgramStatus(LOCAL.getString("progstatus_nodefail")); + intThresholdExceeded = 4; + intAutoSelectCheck = 2; + break; + case 3: + // Get the next best node and trigger test cycle + updateProgramStatus(LOCAL.getString("progstatus_nodefail")); + intNodeFailCount = 0; + intThresholdExceeded = 4; + intAutoSelectCheck = 2; + if (intBeginTesting > 2) { + intBeginTesting = 2; + } + break; + } + break; + case EVENT_CIRCUITS_BUILT: + if (!strRequestedExit.isEmpty()) { + NodeItem ni = nodeList.getNode(strRequestedExit); + if (ni == null) { + activateNode(strRequestedExit = EMPTYSTR); + break; + } + if (ni.getCircuitHops() != null) { + tcMain.activateCircuit(ni.getCircuitHops()); + break; + } + } + case EVENT_CIRCUIT_BUILT: + intNodeFailCount = 0; + intThresholdExceeded = 0; + intLatencyCheck = 1; + // Trigger node testing + if (intBeginTesting == TESTING_DISABLED) { + intBeginTesting = 2; + } + if (boolFirstRun) { + boolFirstRun = false; + // Update geoip check + updateGeoipCheck(); + } + break; + case EVENT_LATENCY_DONE: + if (niActiveExit != null) { + niActiveExit.setStreams(getActiveStreams().size()); + niActiveExit.setLatency(getLatency()); + updateGUINodeInfo(niActiveGuard, niActiveMiddle, niActiveExit); + // Check for threshold override + if (intThresholdExceeded >= 100) { + break; + } + if (niActiveExit.getLatency() > lngThreshold) { + intThresholdExceeded++; + if (niActiveExit.getLatency() > MAXTHRESHOLD) { + // If we have 3 (15 sec) of outright latency failures then trigger test cycle + if (intThresholdExceeded > 2) { + intAutoSelectCheck = 2; + if (intBeginTesting > 2) { + intBeginTesting = 2; + } + } + break; + } + // If we have only have one favourite then effectively + // ignore latency + if (nodeList.getNumberOfFavs() == 1) { + intThresholdExceeded = 0; + break; + } + if (niActiveExit.getStreams() > 0) { + // If we have active streams then do new selection after 1 minute + // of threshold excesses + if (intThresholdExceeded > 11) { + intAutoSelectCheck = 2; + } + } else { + // If we have no active streams then do new selection after 15 secs + // of threshold excesses + if (intThresholdExceeded > 2) { + intAutoSelectCheck = 2; + } + } + break; + } + intThresholdExceeded = 0; + } + break; + } + } + }; + + // Tor main initial startup conditions + tcMain.setTorrcOption("PidFile", cachePath + strSocksPort + OSFunction.getFileSeparator() + "tor.pid" ); + tcMain.setTorrcOption("Log", "notice file " + cachePath + strSocksPort + OSFunction.getFileSeparator() + "notice.log"); + tcMain.setTorrcOption("ClientOnly", "1"); + tcMain.setTorrcOption("StrictNodes", "1"); + tcMain.setTorrcOption("UseMicrodescriptors", "0"); + tcMain.setTorrcOption("UseEntryGuards", "1"); + tcMain.setTorrcOption("NumEntryGuards", "3"); + // default is 600 but I think this helps anon + tcMain.setTorrcOption("MaxCircuitDirtiness", "120"); + + tcMain.setTorrcOption("GeoIPExcludeUnknown", "1"); + if (strExcludeNodes != null) { + tcMain.setTorrcOption("ExcludeNodes", strExcludeNodes); + } + if (strExitNodes != null) { + tcMain.setTorrcOption("ExitNodes", strExitNodes); + } + if (strSocksPort != null && strSocksHost != null) { + tcMain.setTorrcOption("SocksPort", strSocksHost + ':' + strSocksPort); + } + if (strDNSPort != null) { + tcMain.setTorrcOption("DNSPort", strDNSHost + ':' + strDNSPort); + } + if (strHTTPPort != null) { + tcMain.setTorrcOption("HTTPTunnelPort", strHTTPHost + ':' + strHTTPPort); + } + + //breaks tcMain.setTorrcOption("ControlSocket", "/run/tor/control"); + //breaks tcMain.setTorrcOption("ControlSocketsGroupWritable", "1"); + + // broken model + // tcMain.setTorrcOption("SocksPolicy", "accept 127.0.0.1/32"); + // tcMain.setTorrcOption("SocksPolicy", "reject *"); + + tcMain.setStdoutTextArea(tmf.getStdoutTextArea()); + tcMain.setListenPort(sp.getInt("PREF_LISTENPORT")); + tcMain.setOwnershipID(OSFunction.getOurProcessID()); + strSecret = sp.getString("PREF_SECRET"); + strHash = Utilities.getTorHashPassword(strSecret); + tcMain.setTorrcOption("HashedControlPassword", strHash); + tcMain.setControlPassword(strSecret, strHash); + tcMain.setTorrcOption("SandBox", "0"); + } + + /** + * Test thread initialisation + * + * @param nothreads + */ + private void initTestThreads(int nothreads) { + + TorController tcTest; + + // Main testing procedure here, event driven this just handles process declaration + // Initialise our tor testing thread prior to booting it + while (alTestThreads.size() < nothreads) { + tcTest = new TorController(clientLocation, cachePath) { + private NodeItem ni; + + @Override + public void controllerEventFired(int event, Object data) { + + Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(), + "controllerEventFired() on Port=" + getListenPort(), getEventMessage(event) + ", Data=" + data); + + switch (event) { + case TOR_NOROUTE: + if (boolNetEnabled) { + abortTesting(); + stopTestClients(); + updateGUINodeInfo(niActiveGuard = null, niActiveMiddle = null, niActiveExit = null); + tcMain.stop(); + tcMain.setSilentBootEnabled(true); + tcMain.setStartupDelay(intTimeoutStartupDelayMsec); + tcMain.start(TOR_BOOTED); + } + break; + case TOR_BOOT_TIMEOUT: + case TOR_BOOT_FATAL: + ni = null; + stop(); + setSilentBootEnabled(true); + setStartupDelay(intTimeoutStartupDelayMsec); + start(TOR_BOOTED); + break; + case TOR_RESTARTED: + // Deliberate fallthrough here + case TOR_BOOTED: + // Deliberate fallthrough here + ni = null; + case EVENT_TESTING_DONE: + if (ni != null) { + if (intActiveNodeTests > 0) { + intActiveNodeTests--; + } + Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(), + "controllerEventFired() on Port=" + getListenPort(), "Completed Testing of " + ni.getNickName()); + if (getBestLatency() < LATENCY_FAIL) { + ni.setTestStatus(NodeItem.TESTSTATUS_PASSED); + // Store best circuit using its latency as a key + entm.setTestFieldValues(ni.getFingerprint(), + getBestLatency(), + LOCAL.getString("circuit_status_passed"), + getBestHops()); + } else if ((Integer) data > 0) { + ni.setTestStatus(NodeItem.TESTSTATUS_FAILED); + // If we have circuits that failed testing + entm.setTestFieldValues(ni.getFingerprint(), + LATENCY_FAIL, + LOCAL.getString("circuit_status_failed"), null); + } else { + // If we have no circuits + ni.setTestStatus(NodeItem.TESTSTATUS_FAILED); + entm.setTestFieldValues(ni.getFingerprint(), + LATENCY_FAIL, + LOCAL.getString("circuit_status_none"), null); + stop(); + setSilentBootEnabled(true); + setStartupDelay(intTimeoutStartupDelayMsec); + start(TOR_RESTARTED); + break; + } + } + ni = null; + // Ensure test thread is ready + if (getStatus() != STATUS_IDLE) { + break; + } + // No more nodes to test + if (alTestQueue.isEmpty()) { + // Check to see that all testing threads have completed + if (intActiveNodeTests <= 0) { + stopTestClients(); + // Re-Enable testing menu button + jMenuTesting.setEnabled(true); + // intActiveNodeTests will be -1 if testing was aborted + if (intActiveNodeTests == 0) { + // Start next test in 10 minutes + intBeginTesting = 600; + // Force change on next Autoselection check + intThresholdExceeded = 255; + // Force Autoselection check in 1 second + intAutoSelectCheck = 1; + } + return; + } + return; + } + // Fetch node item from queue + while (!alTestQueue.isEmpty()) { + String finger = alTestQueue.get(0); + alTestQueue.remove(0); + ni = nodeList.getNode(finger); + if (ni != null) { + intActiveNodeTests++; + entm.setValueAt(LOCAL.getString("circuit_status_creating_3hop"), + ni.getFingerprint(), 3); + Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(), + "controllerEventFired() on Port=" + getListenPort(), "Begun testing node " + ni.getNickName()); + testNode(ni.getFingerprint()); + } else { + Logger.getGlobal().logp(Level.INFO, SelekTOR.class.getName(), + "controllerEventFired() on Port=" + getListenPort(), finger + " node not found in nodelist "); + entm.setValueAt(LOCAL.getString("circuit_status_failed"), + finger, 3); + } + break; + } + break; + case EVENT_CIRCUIT_BUILT: + if (ni != null) { + entm.setValueAt(LOCAL.getString("circuit_status_testing"), ni.getFingerprint(), 3); + } + break; + case EVENT_ABORTED: + if (intActiveNodeTests > 0) { + intActiveNodeTests--; + } + if (ni != null) { + entm.setValueAt(LOCAL.getString("circuit_status_aborted"), + ni.getFingerprint(), 3); + ni.setTestStatus(NodeItem.TESTSTATUS_UNKNOWN); + ni = null; + } + break; + case TOR_DIRINFO_STALE: + case TOR_NOEXITS: + if (intActiveNodeTests > 0) { + intActiveNodeTests--; + } + if (ni != null) { + entm.setTestFieldValues(ni.getFingerprint(), + LATENCY_FAIL, + LOCAL.getString("circuit_status_noroute"), null); + ni.setTestStatus(NodeItem.TESTSTATUS_FAILED); + ni = null; + stop(); + setSilentBootEnabled(true); + setStartupDelay(intTimeoutStartupDelayMsec); + start(TOR_RESTARTED); + } + break; + } + } + + }; + tcTest.setTorrcOption("ClientOnly", "1"); + tcTest.setTorrcOption("StrictNodes", "1"); + tcTest.setTorrcOption("UseMicrodescriptors", "0"); + tcTest.setTorrcOption("UseEntryGuards", "1"); + tcTest.setTorrcOption("NumEntryGuards", "3"); + tcTest.setOwnershipID(tcMain.getOwnershipID()); + tcTest.setControlPassword(strSecret, strHash); + tcTest.setTorrcOption("HashedControlPassword", strHash); + tcTest.setCLIOption("quiet", EMPTYSTR); + + // Add this this tor process thread to our thread queue + alTestThreads.add(tcTest); + } + strSecret = strHash = null; + } + + /** + * Auto select next best node based on latency + * + */ + private void autoSelectNode() { + + String finger; + switch (intThresholdExceeded) { + case 255: + intThresholdExceeded = 0; + // Recaculate best nodes + calcBestNodes(); + resetBestNode(); + finger = getBestNode(); + break; + case 254: + // this will re-apply previously selected node + finger = strRequestedExit; + strRequestedExit = EMPTYSTR; + break; + default: + // Indicate node has failed testing + NodeItem ni = null; + if (niActiveExit != null && nodeList.getNumberOfFavs() != 1) { + ni = nodeList.getNode(niActiveExit.getFingerprint()); + if (ni != null) { + ni.setTestStatus(NodeItem.TESTSTATUS_FAILED); + } + } + // Get next best node + finger = getBestNode(); + break; + } + intThresholdExceeded = 0; + + // Check to see if finger is valid + if (finger != null && !finger.isEmpty()) { + if (!finger.contentEquals(strRequestedExit)) { + strRequestedExit = finger; + updateProgramStatus(LOCAL.getString("progstatus_autoswitch") + + " " + activateNode(strRequestedExit) + "."); + } + } else { + updateProgramStatus(LOCAL.getString("progstatus_nodefailtorchoose")); + strRequestedExit = EMPTYSTR; + activateNode(strRequestedExit); + } + + } + + /** + * Set latency threshold value and update its corresponding label + * + * @param threshold + */ + private void setThreshold(long threshold) { + lngThreshold = threshold; + jTableExitNodes.setToolTipText(LOCAL.getString("ttip_threshold") + + ": " + lngThreshold + " ms"); + } + + /** + * Calculate best nodes based on latency and also generate the latency + * threshold value + */ + private void calcBestNodes() { + + long l; + long summation = 0; + long mean = TorController.LATENCY_FAIL; + int i = 0; + ArrayList alBestNodes = new ArrayList<>(); + ArrayList alBestFavs = new ArrayList<>(); + TableRowSorter trs = new TableRowSorter<>(entm); + trs.toggleSortOrder(2); + + for (int idx = 0; idx < entm.getRowCount(); idx++) { + NodeItem ni = entm.getNodeItemAt(trs.convertRowIndexToModel(idx)); + if (ni.getTestStatus() == NodeItem.TESTSTATUS_FAILED) { + continue; + } + if (ni.isFavourite()) { + alBestFavs.add(ni.getFingerprint()); + } + // Calculate our new weighted threshold value + l = ni.getTestLatency(); + if (l >= mean) { + continue; + } + summation += l; + mean = (summation / (i + 1)) * 3; + i++; + alBestNodes.add(ni.getFingerprint()); + } + // New threshold result, prevent divide by zero + if (i == 0) { + setThreshold(MAXTHRESHOLD); + } else { + setThreshold((summation / i) + 100); + } + if (alBestFavs.isEmpty()) { + while (alBestNodes.size() > 5) { + alBestNodes.remove(alBestNodes.remove(alBestNodes.size() - 1)); + } + strArrBestNodes = alBestNodes.toArray(new String[alBestNodes.size()]); + } else { + strArrBestNodes = alBestFavs.toArray(new String[alBestFavs.size()]); + } + } + + private void resetTestFields() { + for (int i = 0; i < entm.getRowCount(); i++) { + entm.setValueAt(TorController.LATENCY_FAIL, i, 2); + entm.setValueAt(LOCAL.getString("textfield_unknown"), i, 3); + entm.setValueAt(null, i, 6); + } + } + + /** + * Begin the test cycle + */ + private void runTestingCycle() { + + // Setting intBeginTesting to -1 prevents re-triggering of testing cycle until it has completed + intBeginTesting = TESTING_ACTIVE; + // Update table status column to show unknown and reset the latency column to 9999 + intActiveNodeTests = 0; + jMenuTesting.setEnabled(false); + jTableExitNodes.getRowSorter().setSortKeys(null); + resetTestFields(); + // Add all nodes to the individual test thread queues + alTestQueue.addAll(nodeList.getExitNodes(true, false)); + + // Some more inititalisation of test process threads + long delay = 0; + int listenport = tcMain.getListenPort(); + for (TorController tc : alTestThreads) { + listenport += 2; + tc.setListenPort(listenport); + tc.setCachedDataFolder(tcMain.getListenPort()); + tc.setBridges(sp.getString("PREF_TORBRIDGE")); + tc.setEntryNodes(tcMain.getEntryGuardsAsCSV()); + tc.setTestingURL(TESTURL); + tc.setBoolTorOption("SafeSocks", sp.getBool("PREF_SAFESOCKS")); + tc.setBoolTorOption("TestSocks", sp.getBool("PREF_TESTSOCKS")); + tc.setBoolTorOption("AvoidDiskWrites", sp.getBool("PREF_AVOIDDISK")); + tc.setBoolTorOption("SafeLogging", sp.getBool("PREF_SAFELOG")); + tc.setGeoIP4(geoipPath); + tc.setGeoIP6(geoip6Path); + tc.setExternalArgs(sp.getString("PREF_TORARGS")); + tc.setLogLevel(sp.getInt("PREF_TORLOGLEV")); + tc.setSilentBootEnabled(true); + tc.setStartupDelay(delay); + delay += intTimeoutSocketMsec; + tc.start(); + } + } + + /** + * Cleanly abort any node testing + */ + private void abortTesting() { + intBeginTesting = TESTING_DISABLED; + for (TorController tcTest : alTestThreads) { + tcTest.abortActions(); + } + intActiveNodeTests = -1; + alTestQueue.clear(); + jMenuTesting.setEnabled(true); + } + + /** + * Terminate all test threads cleanly, this is permanent and would require a + * call to initTestThreads prior to starting them again + */ + private void stopTestClients() { + for (TorController tc : alTestThreads) { + tc.stop(); + } + } + + /** + * Gets the node with the best circuit hops + * + * @return String with the best circuit hops or empty string if we don't + * have any or null if we have run out of good nodes + */ + private String getBestNode() { + // Check for no table or empty table + if (strArrBestNodes == null || strArrBestNodes.length == 0) { + intBestNodeIndex = 0; + return EMPTYSTR; + } + // Check for end of table + if (intBestNodeIndex > (strArrBestNodes.length - 1)) { + intBestNodeIndex = 0; + if (intBeginTesting > 2) { + intBeginTesting = 2; + } + return null; + } + return strArrBestNodes[intBestNodeIndex++]; + } + + /** + * Reset to the best node + */ + private void resetBestNode() { + intBestNodeIndex = 0; + } + + /** + * Update program status message + * + * @param message + */ + private synchronized void updateProgramStatus(String message) { + if (message != null) { + jLabStatus.setText(message); + Logger.getGlobal().log(Level.INFO, "updateProgramStatus {0}", message); + } + } + + private void getFreshNodeInfo() { + TorCircuit tc = tcMain.getLatestCircuit(); + if (tc == null) { + return; + } + // Get active guard node item + String finger = tc.getGuard(TorCircuit.FINGER); + niActiveGuard = nodeList.getNode(finger).clone(); + // Get exitnode info + finger = tc.getExit(TorCircuit.FINGER); + niActiveExit = (NodeItem) nodeList.getNode(finger).clone(); + niActiveExit.setCircuitHops(tc.getHops()); + niActiveExit.setLatency(TorController.LATENCY_FAIL); + // Get active middle node item + finger = tc.getMiddleMan(TorCircuit.FINGER); + niActiveMiddle = nodeList.getNode(finger).clone(); + } + + /** + * Convenience method to refresh all the GUI labels related to Node + * information + * + * @param niexit Requires the active node item to be provided + */ + private void updateGUINodeInfo(NodeItem niguard, NodeItem nimiddle, NodeItem niexit) { + + if (nimiddle == null) { + jLabelMiddleStable.setText(LOCAL.getString("textfield_unknown")); + jLabelMiddleBw.setText(LOCAL.getString("textfield_unknown")); + jLabelMiddleNick.setText(LOCAL.getString("textfield_unknown")); + jLabelMiddleIP.setText(LOCAL.getString("textfield_unknown")); + jLabelMiddleCountry.setText(LOCAL.getString("textfield_unknown")); + jButtonMiddleNodeDetails.setEnabled(false); + } else { + jLabelMiddleNick.setText(nimiddle.getNickName()); + jLabelMiddleIP.setText(nimiddle.getIPAddress()); + jLabelMiddleCountry.setText(nimiddle.getCountryName()); + jLabelMiddleBw.setText(String.valueOf(nimiddle.getBandwidth()) + " MB\\s"); + jLabelMiddleStable.setText(nimiddle.getStability()); + jButtonMiddleNodeDetails.setEnabled(true); + } + + if (niexit == null) { + intLatencyCheck = 0; + intAutoSelectCheck = 0; + jLabelExitNick.setText(LOCAL.getString("textfield_unknown")); + jLabelExitIP.setText(LOCAL.getString("textfield_unknown")); + jLabelExitCountry.setText(LOCAL.getString("textfield_unknown")); + jLabelExitBw.setText(LOCAL.getString("textfield_unknown")); + jLabelExitStable.setText(LOCAL.getString("textfield_unknown")); + jLabelTorLatency.setText(LOCAL.getString("textfield_unknown")); + jLabelStreams.setText(LOCAL.getString("textfield_unknown")); + jLabelGuardStable.setText(LOCAL.getString("textfield_unknown")); + jLabelGuardBw.setText(LOCAL.getString("textfield_unknown")); + jLabelGuardNick.setText(LOCAL.getString("textfield_unknown")); + jLabelGuardIP.setText(LOCAL.getString("textfield_unknown")); + jLabelGuardCountry.setText(LOCAL.getString("textfield_unknown")); + jButtonExitNodeDetails.setEnabled(false); + jButtonGuardNodeDetails.setEnabled(false); + jMenuItemTorCheck.setEnabled(false); + } else { + jLabelExitNick.setText(niexit.getNickName()); + jLabelExitIP.setText(niexit.getIPAddress()); + jLabelExitCountry.setText(niexit.getCountryName()); + jLabelExitBw.setText(String.valueOf(niexit.getBandwidth()) + " MB\\s"); + jLabelExitStable.setText(niexit.getStability()); + jButtonExitNodeDetails.setEnabled(true); + jLabelGuardNick.setText(niguard.getNickName()); + jLabelGuardIP.setText(niguard.getIPAddress()); + jLabelGuardCountry.setText(niguard.getCountryName()); + jLabelGuardBw.setText(String.valueOf(niguard.getBandwidth()) + " MB\\s"); + jLabelGuardStable.setText(niguard.getStability()); + jMenuItemTorCheck.setEnabled(true); + jButtonGuardNodeDetails.setEnabled(true); + if (niexit.getLatency() > 5000) { + jLabelTorLatency.setText("> 5000 ms"); + } else { + jLabelTorLatency.setText(String.valueOf(niexit.getLatency()) + " ms"); + } + jLabelStreams.setText(String.valueOf(niexit.getStreams())); + updateProgramStatus(LOCAL.getString("progstatus_nodeactive3hop").replace("$nodename", niActiveExit.getNickName())); + dn.raiseNotification(); + } + String text = LOCAL.getString("label_country") + " : " + sp.getString("PREF_ISOCOUNTRY"); + text += "\n" + LOCAL.getString("traymenu_proxymode" + (sp.getInt("PREF_PROXY_MODE") + 1)); + text += "\n" + LOCAL.getString("traytool_guardnode") + " : " + jLabelGuardNick.getText(); + text += "\n" + LOCAL.getString("traytool_exitnode") + " : " + jLabelExitNick.getText(); + text += "\n" + LOCAL.getString("label_torlatency") + " : " + jLabelTorLatency.getText(); + text += "\n" + LOCAL.getString("label_streams") + " : " + jLabelStreams.getText(); + sti.setInfoTip(text); + } + + /** + * Convenience method to update the exit node table + * + */ + private void updateExitNodeTable() { + try { + strArrBestNodes = null; + intRowSelected = -1; + // Set in an empty model while we do the update of its model to avoid event collision issues + jTableExitNodes.setModel(new ExitNodeTableModel()); + nodeList.refreshExitTableModel(strExitISOCode); + jTableExitNodes.setModel(entm); + resetTestFields(); + calcBestNodes(); + } catch (Exception ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "updateExitNodeTable()", EMPTYSTR, ex); + } + updateGUINodeInfo(null, null, null); + setComponentsEnabled(true); + } + + /** + * Adjust exit table column widths + */ + private void adjustExitTableColumns() { + // Adjust table column widths + String col3 = LOCAL.getString("circuit_status_creating_2hop"); + if (col3.length() > 6) { + col3 = col3.substring(0, col3.length() - 2); + } else { + col3 = "XXXXXXXXXXXXXXXXXX"; + } + Utilities.adjustTableColumnWidth(jTableExitNodes, + "XXXXXXXXXXXXXXXXXX", + jTableExitNodes.getColumnName(1) + "X", + jTableExitNodes.getColumnName(2) + "X", + col3, + jTableExitNodes.getColumnName(4) + "X"); + } + + /** + * Returns the selected fingerprint + * + * @param row + * @return Fingerprint as String + */ + private String getSelectedFinger(int row) { + return (String) entm.getValueAt(row, 5); + } + + /** + * Tests first to see if node is in the exitnode list + * + * @param finger + * @return true if specified node is in the exit node table + */ + private boolean isValidExit(String finger) { + return nodeList.getExitNodes(true, false).contains(finger); + } + + /** + * Activates specified node with fingerprint finger, also returns the node + * name + * + * @param finger + * @return Node name + */ + private String activateNode(String fingerprint) { + String result = EMPTYSTR; + updateGUINodeInfo(niActiveGuard = null, niActiveMiddle = null, niActiveExit = null); + if (boolFirstRun) { + tcMain.closeCircuitsExcept("", true); + } + if (fingerprint.isEmpty()) { + // Get a list of exit nodes based on auto node selection mode + ArrayList alFingers = nodeList.getExitNodes(false, true); + if (alFingers.isEmpty()) { + // Get a list of all exit nodes + alFingers = nodeList.getExitNodes(true, true); + } + if (alFingers.isEmpty()) { + // Get a list of all exit nodes + alFingers = nodeList.getExitNodes(true, true); + } + // Randomly select from given list of nodes + Random rand = new Random(); + int idx = rand.nextInt(alFingers.size()); + fingerprint = alFingers.get(idx); + tcMain.activateNodes(fingerprint, 1); + } else if (!fingerprint.startsWith("$")) { + tcMain.activateNodes(fingerprint, 1); + } else { + NodeItem ni = nodeList.getNode(fingerprint); + tcMain.activateNodes(fingerprint, 1); + if (ni != null) { + ni.setTestStatus(NodeItem.TESTSTATUS_PASSED); + result = ni.getNickName(); + } else { + result = fingerprint; + } + } + return result; + } + + /** + * Called when the country is changed via the combo box change event + * + */ + private void countryChanged() { + + // Some essential resets of variables + niActiveExit = null; + + // Get selected country + String iso = (String) jComboCountry.getSelectedItem(); + iso = iso.substring(0, 2); + if (!strExitISOCode.contentEquals(iso)) { + // Save new country to properties file + sp.setString("PREF_ISOCOUNTRY", strExitISOCode = iso); + sp.save(); + } + + rebuildPatternPac(); + + updateExitNodeTable(); + adjustExitTableColumns(); + + updateProgramStatus(LOCAL.getString("progstatus_waitfortor")); + activateNode(strRequestedExit = EMPTYSTR); + } + + /** + * Cleans up pac files and proxies + */ + private void pacCleanup() { + if (pacFactory != null) { + pacFactory.restoreProxyPrefs(false); + pacFactory.deleteProxyPrefs(); + pacFactory.deleteAllPAC(); + } + } + + /** + * The main application exit routine also does cleanup before exiting + * + */ + public final void cleanupExit() { + try { + setVisible(false); + // Need to ensure various processes are cleanly terminated before we can exit + if (tmr != null) { + tmr.stop(); + } + if (sti != null) { + sti.dispose(); + } + if (nodeList != null) { + nodeList.terminate(); + } + if (tmf != null) { + tmf.dispose(); + } + // Terminate all tor threads + if (tcMain != null) { + tcMain.stop(); + } + stopTestClients(); + pacCleanup(); + if (sp.getBool("PREF_CACHEDELETE")) { + SimpleFile.secureWipeFolder(cachePath); + } + } catch (Exception ex) { + } + Logger.getGlobal().log(Level.INFO, "Cleanup completed, shutting down"); + dispose(); + System.exit(0); + } + + /** + * Change visibilty of gUI + * + */ + private void initGUIVisibility() { + // Bring up gui + pack(); + setLocationRelativeTo(this); + Utilities.registerWindow(); + if (sp.getBool("PREF_HIDETOTRAY")) { + if (sp.getBool("PREF_HIDE_MIN") && sti.isLoaded()) { + setVisible(false); + } else { + setVisible(true); + SwingUtilities.invokeLater(new java.lang.Runnable() { + + @Override + public void run() { + repaint(); + setExtendedState(Frame.ICONIFIED); + } + }); + } + } else { + setVisible(true); + } + } + + /** + * Toggle GUI visibility + */ + private void toggleGUIVisibility() { + + if (OSFunction.isLinux()) { + requestFocus(); + } + SwingUtilities.invokeLater(new java.lang.Runnable() { + + @Override + public void run() { + if (!isVisible()) { + setVisible(true); + setExtendedState(Frame.NORMAL); + return; + } + if ((getExtendedState() & Frame.ICONIFIED) != 0) { + setExtendedState(Frame.NORMAL); + toFront(); + } else { + if (OSFunction.isLinux()) { + switch (desktopname) { + case "kde4": + if (compositor.contentEquals("kwin")) { + if (getFocusOwner() == null) { + setVisible(false); + setVisible(true); + return; + } + } + break; + case "mate": + if (compositor.contentEquals("compiz")) { + if (getFocusOwner() == null) { + setExtendedState(Frame.NORMAL); + toFront(); + return; + } + } else if (getFocusOwner() == null) { + setVisible(false); + setVisible(true); + return; + } + break; + default: + if (getFocusOwner() == null) { + setExtendedState(Frame.NORMAL); + toFront(); + return; + } + break; + } + } + if (sp.getBool("PREF_HIDE_MIN") && sti.isLoaded()) { + setVisible(false); + } else { + setExtendedState(Frame.ICONIFIED); + } + } + } + }); + } + + /** + * Open the about dialog + */ + private void openAboutDialog() { + AboutDialog ad = new AboutDialog(this, true); + ad.setButtonCloseText(LOCAL.getString("button_close")); + ad.setButtonVisitText(LOCAL.getString("button_visitus")); + ad.setButtonContactText(LOCAL.getString("button_contactus")); + ad.setTitle(LOCAL.getString("wintitle_about").replace("$appname", APPNAME)); + ad.setContactURL(CONTACT); + ad.setHomeURL(HOMEPAGE_SSL); + ad.setAppLogo(new javax.swing.ImageIcon(iconPath + ICONFILE)); + String desc = LOCAL.getString("appdesc").replace("$appname", APPNAME); + desc = desc.replace("$appver", APPVER) + "\n\nCopyright 2009-2017\nAlistair Neil"; + ad.setAppDescription(desc); + ad.setLocationRelativeTo(this); + ad.pack(); + ad.setVisible(true); + } + + /** + * Open the licensing dialog + */ + private void openLicenseDialog() { + TextResourceDialog trd = new TextResourceDialog(this, true); + trd.setTitle(LOCAL.getString("dlg_license_title")); + trd.setURLButtonText(LOCAL.getString("button_translations")); + trd.setButtonURL(LOCAL.getString("gpltransurl")); + trd.setCloseButtonText(LOCAL.getString("button_close")); + trd.setTitle(LOCAL.getString("dlg_license_title").replace("$appname", APPNAME)); + trd.setText(Utilities.getTextFromResource("/resources/license.txt")); + trd.setLocationRelativeTo(this); + trd.setVisible(true); + } + + /** + * Open the licensing dialog + */ + private void openCreditsDialog() { + TextResourceDialog trd = new TextResourceDialog(this, true); + trd.setTitle(LOCAL.getString("dlg_credits_title")); + trd.setButtonURL(PATREON); + trd.setURLButtonText(LOCAL.getString("button_patreon")); + trd.setCloseButtonText(LOCAL.getString("button_close")); + trd.setTitle(LOCAL.getString("dlg_credits_title").replace("$appname", APPNAME)); + trd.setText(LOCAL.getString("dlg_credits_body") + "\n\n" + + Utilities.getTextFromResource("/resources/credits.txt")); + trd.setLocationRelativeTo(this); + trd.setVisible(true); + } + + /** + * Open the user pattern export file chooser + */ + private void openPatternExport() { + File[] files = pacFactory.getPatternsFiles(); + if (files.length == 0) { + InfoDialog id = createInfoDialog(); + id.createWarn(LOCAL.getString("dlg_exportuser_title"), + LOCAL.getString("dlg_exportuser_body")); + id.setContinueButtonText(LOCAL.getString("button_close")); + id.setCancelVisible(false); + id.pack(); + id.setVisible(true); + return; + } + // Lets choose our zip filename or overwrite an existing zip file + JFileChooser jfc = new JFileChooser(); + jfc.setDialogTitle(LOCAL.getString("dlg_saveuser_title")); + if (jfc.showSaveDialog(this) != JFileChooser.APPROVE_OPTION) { + return; + } + pacFactory.exportUserPatterns(jfc.getSelectedFile().getAbsolutePath(), files); + } + + /** + * Open the pattern import file chooser + */ + private void openPatternImport() { + JFileChooser jfc = new JFileChooser(); + ExtensionFileFilter filter = new ExtensionFileFilter(LOCAL.getString("fileext_pattern"), new String[]{"zip"}); + jfc.setFileFilter(filter); + jfc.setDialogTitle(LOCAL.getString("dlg_import_title")); + if (jfc.showOpenDialog(this) != JFileChooser.APPROVE_OPTION) { + return; + } + InfoDialog id = createInfoDialog(); + if (pacFactory.importPatterns(jfc.getSelectedFile().getAbsolutePath())) { + rebuildPatternPac(); + id.createWarn(LOCAL.getString("dlg_import_success_title"), + LOCAL.getString("dlg_import_success_body")); + id.setCancelVisible(false); + id.pack(); + id.setVisible(true); + } else { + id.createWarn(LOCAL.getString("dlg_import_fail_title"), + LOCAL.getString("dlg_import_fail_body")); + id.setCancelVisible(false); + id.pack(); + id.setVisible(true); + } + } + + /** + * Open the pattern editor + */ + private void openPatternEditorDialog() { + PatternsEditor pe = new PatternsEditor(this, true, pacFactory); + pe.populateCountryComboBox(nodeList.getValidatedCountries()); + pe.setSelectedCountry((String) jComboCountry.getSelectedItem()); + pe.setTitle(LOCAL.getString("wintitle_patternedit").replace("$appname", APPNAME)); + pe.pack(); + pe.setLocationRelativeTo(this); + pe.setVisible(true); + sp.setString("PREF_DONOT_PROXY", pacFactory.getDoNotProxy()); + if (sp.getChangedProperties().contains("PREF_DONOT_PROXY")) { + sp.save(); + } + if (pe.getReturnStatus() == PatternsEditor.APPLY) { + rebuildPatternPac(); + } + } + + /** + * Open Quick Add pattern dialog + */ + private void openQuickAddDialog() { + QuickAddDialog qad = new QuickAddDialog(this, true); + qad.pack(); + qad.setLocationRelativeTo(this); + qad.setVisible(true); + if (qad.getReturnStatus() == QuickAddDialog.APPLY && strExitISOCode != null) { + pacFactory.addToPatternFile(strExitISOCode, qad.getDescription(), qad.getPattern()); + rebuildPatternPac(); + } + } + + /** + * Open Tor client to old dialog + */ + private void openToOldDialog() { + openFatalErrorDialog(LOCAL.getString("dlg_toold_body")); + } + + /** + * Open the fatal error dialog + * + * @param errmessage + */ + private void openFatalErrorDialog(String errmessage) { + String text = "\n\n" + LOCAL.getString("dlg_error_body").replace("$appname", APPNAME); + InfoDialog id = createInfoDialog(); + id.setSize(500, 450); + id.createInfo(LOCAL.getString("dlg_error_title"), errmessage + text); + id.setModal(true); + id.pack(); + id.setLocationRelativeTo(this); + id.pack(); + id.setVisible(true); + } + + /** + * Open the guards node setting dialog + */ + private void openGuardsSettingDialog() { + GuardNodeDialog gnd = new GuardNodeDialog(this, true); + gnd.setNodeList(nodeList); + gnd.pack(); + gnd.setLocationRelativeTo(this); + gnd.setVisible(true); + if (gnd.getReturnStatus() == GuardNodeDialog.APPLY) { + if (sp.getString("PREF_TORBRIDGE").isEmpty()) { + updateProgramStatus(LOCAL.getString("progstatus_applychanges")); + abortAllTorThreads(); + applyMainTorSettings(); + tcMain.start(); + } + } + } + + /** + * Open the standard out dialog + */ + private void openTorMonitor() { + tmf.setLocationRelativeTo(this); + tmf.setVisible(true); + } + + /** + * Called when proxy mode is changed by the user + * + * @param mode Proxy mode + */ + private void proxyModeChanged(int mode) { + sp.setInt("PREF_PROXY_MODE", mode); + sp.save(); + dn.setNotificationBody(LOCAL.getString("traymenu_proxymode" + (sp.getInt("PREF_PROXY_MODE") + 1))); + applyProxyChanges(mode); + } + + /** + * Apply any proxy changes based on current proxy mode + * + * @param mode Proxy mode + */ + private void applyProxyChanges(int mode) { + if (tcMain == null) { + return; + } + switch (mode) { + case PacFactory.PROXY_DISABLED: + pacFactory.restoreProxyPrefs(true); + pacFactory.deleteAllPAC(); + break; + case PacFactory.PROXY_PATTERN: + pacFactory.createPacFile(strExitISOCode, tcMain.getListenPort()); + break; + case PacFactory.PROXY_ALL: + pacFactory.createPacFile("proxyall", tcMain.getListenPort()); + break; + } + } + + /** + * Rebuilds pattern pacfile but only if we are in pattern mode + */ + private void rebuildPatternPac() { + if (sp.getInt("PREF_PROXY_MODE") == PacFactory.PROXY_PATTERN) { + applyProxyChanges(sp.getInt("PREF_PROXY_MODE")); + } + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + popupTable = new javax.swing.JPopupMenu(); + jMenuNodeDetails = new javax.swing.JMenuItem(); + jMenuWhois = new javax.swing.JMenuItem(); + jMenuTesting = new javax.swing.JMenuItem(); + jMenuItemGUI = new javax.swing.JMenuItem(); + jMenuItemQuitx = new javax.swing.JMenuItem(); + buttonGroupProxy = new javax.swing.ButtonGroup(); + buttonGroupProxyTray = new javax.swing.ButtonGroup(); + jCheckTrayProxyDisable = new javax.swing.JCheckBoxMenuItem(); + jCheckTrayProxyByPattern = new javax.swing.JCheckBoxMenuItem(); + jCheckTrayProxyAll = new javax.swing.JCheckBoxMenuItem(); + jPanelMain = new javax.swing.JPanel(); + jLabelCountry = new javax.swing.JLabel(); + jComboCountry = new javax.swing.JComboBox<>(); + jScrollPaneExitNodes = new javax.swing.JScrollPane(); + jTableExitNodes = new javax.swing.JTable(); + jPanelNodeInfo = new javax.swing.JPanel(); + jLabel5 = new javax.swing.JLabel(); + jLabelGuardBw = new javax.swing.JLabel(); + jLabel10 = new javax.swing.JLabel(); + jLabelGuardStable = new javax.swing.JLabel(); + jLabelGuard = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + jLabelGuardNick = new javax.swing.JLabel(); + jLabelGuardIP = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jLabelGuardCountry = new javax.swing.JLabel(); + jLabel12 = new javax.swing.JLabel(); + jLabelExitNick = new javax.swing.JLabel(); + jLabelExitIP = new javax.swing.JLabel(); + jLabelMiddle = new javax.swing.JLabel(); + jLabelExit = new javax.swing.JLabel(); + jLabelMiddleNick = new javax.swing.JLabel(); + jLabelMiddleIP = new javax.swing.JLabel(); + jLabelMiddleCountry = new javax.swing.JLabel(); + jButtonExitNodeDetails = new javax.swing.JButton(); + jButtonGuardNodeDetails = new javax.swing.JButton(); + jButtonMiddleNodeDetails = new javax.swing.JButton(); + jLabelMiddleBw = new javax.swing.JLabel(); + jLabelExitBw = new javax.swing.JLabel(); + jLabelMiddleStable = new javax.swing.JLabel(); + jLabelExitStable = new javax.swing.JLabel(); + jLabelExitCountry = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabelTorLatency = new javax.swing.JLabel(); + jLabelStreams = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jButtonSetGuards = new javax.swing.JButton(); + jLabStatus = new javax.swing.JLabel(); + jButtonClearFavs = new javax.swing.JButton(); + jMenuBar = new javax.swing.JMenuBar(); + jMenuMenu = new javax.swing.JMenu(); + jMenuItemPrefs = new javax.swing.JMenuItem(); + jMenuItemAddPattern = new javax.swing.JMenuItem(); + jMenuItemPatternEdit = new javax.swing.JMenuItem(); + jMenuItemStdout = new javax.swing.JMenuItem(); + jMenuItemExport = new javax.swing.JMenuItem(); + jMenuItemImport = new javax.swing.JMenuItem(); + jMenuItemGeoip = new javax.swing.JMenuItem(); + jMenuItemQuit = new javax.swing.JMenuItem(); + jMenuProxy = new javax.swing.JMenu(); + jCheckProxyDisable = new javax.swing.JCheckBoxMenuItem(); + jCheckProxyByPattern = new javax.swing.JCheckBoxMenuItem(); + jCheckProxyAll = new javax.swing.JCheckBoxMenuItem(); + jMenuHelp = new javax.swing.JMenu(); + jMenuItemDebugLog = new javax.swing.JMenuItem(); + jMenuItemHelp = new javax.swing.JMenuItem(); + jMenuItemTorMan = new javax.swing.JMenuItem(); + jMenuItemTorCheck = new javax.swing.JMenuItem(); + jMenuItemAbout = new javax.swing.JMenuItem(); + jMenuItemLicense = new javax.swing.JMenuItem(); + + popupTable.addPopupMenuListener(new javax.swing.event.PopupMenuListener() { + public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) { + popupTablePopupMenuWillBecomeVisible(evt); + } + public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) { + } + public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) { + } + }); + + jMenuNodeDetails.setText(LOCAL.getString("table_popup_details")); // NOI18N + jMenuNodeDetails.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuNodeDetailsActionPerformed(evt); + } + }); + popupTable.add(jMenuNodeDetails); + + jMenuWhois.setText(LOCAL.getString("table_popup_whois")); // NOI18N + jMenuWhois.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuWhoisActionPerformed(evt); + } + }); + popupTable.add(jMenuWhois); + + jMenuTesting.setText(LOCAL.getString("table_popup_begintest")); // NOI18N + jMenuTesting.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuTestingActionPerformed(evt); + } + }); + popupTable.add(jMenuTesting); + + jMenuItemGUI.setBackground(new Color(jMenuBar.getBackground().getRGB())); + jMenuItemGUI.setForeground(new Color(jMenuBar.getForeground().getRGB())); + + jMenuItemGUI.setText(LOCAL.getString("traymenu_showgui")); // NOI18N + jMenuItemGUI.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemGUIActionPerformed(evt); + } + }); + + jMenuItemQuitx.setText(LOCAL.getString("menu_quit")); // NOI18N + jMenuItemQuitx.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemQuitxActionPerformed(evt); + } + }); + + jCheckTrayProxyDisable.setText(LOCAL.getString("combo_proxymode1")); // NOI18N + jCheckTrayProxyDisable.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jCheckTrayProxyDisableItemStateChanged(evt); + } + }); + + jCheckTrayProxyByPattern.setText(LOCAL.getString("combo_proxymode2")); // NOI18N + jCheckTrayProxyByPattern.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jCheckTrayProxyByPatternItemStateChanged(evt); + } + }); + + jCheckTrayProxyAll.setText(LOCAL.getString("combo_proxymode3")); // NOI18N + jCheckTrayProxyAll.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jCheckTrayProxyAllItemStateChanged(evt); + } + }); + + setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); + setResizable(false); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowClosing(java.awt.event.WindowEvent evt) { + formWindowClosing(evt); + } + }); + + jPanelMain.setFont(jPanelMain.getFont().deriveFont(jPanelMain.getFont().getStyle() | java.awt.Font.BOLD, jPanelMain.getFont().getSize()+1)); + + jLabelCountry.setFont(jLabelCountry.getFont().deriveFont(jLabelCountry.getFont().getStyle() | java.awt.Font.BOLD)); + jLabelCountry.setText(LOCAL.getString("label_activecountry")); // NOI18N + + jComboCountry.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jComboCountryItemStateChanged(evt); + } + }); + + jTableExitNodes.setAutoCreateRowSorter(true); + jTableExitNodes.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + {}, + {}, + {}, + {} + }, + new String [] { + + } + )); + jTableExitNodes.setToolTipText(LOCAL.getString("ttip_threshold") +" : "+ LOCAL.getString("textfield_unknown") + ); + jTableExitNodes.setComponentPopupMenu(popupTable); + jTableExitNodes.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); + jTableExitNodes.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jTableExitNodesMouseClicked(evt); + } + }); + jScrollPaneExitNodes.setViewportView(jTableExitNodes); + + jPanelNodeInfo.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_info"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelMain.getFont())); // NOI18N + jPanelNodeInfo.setFont(jPanelNodeInfo.getFont().deriveFont(jPanelNodeInfo.getFont().getStyle() | java.awt.Font.BOLD)); + + jLabel5.setFont(jLabel5.getFont().deriveFont(jLabel5.getFont().getStyle() | java.awt.Font.BOLD)); + jLabel5.setText(LOCAL.getString("label_bandwidth")); // NOI18N + + jLabelGuardBw.setText(LOCAL.getString("textfield_unknown")); // NOI18N + jLabelGuardBw.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabel10.setFont(jLabel10.getFont().deriveFont(jLabel10.getFont().getStyle() | java.awt.Font.BOLD)); + jLabel10.setText(LOCAL.getString("label_stable")); // NOI18N + + jLabelGuardStable.setText(LOCAL.getString("textfield_unknown")); // NOI18N + jLabelGuardStable.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabelGuard.setFont(jLabelGuard.getFont().deriveFont(jLabelGuard.getFont().getStyle() | java.awt.Font.BOLD)); + jLabelGuard.setText(LOCAL.getString("label_guard")); // NOI18N + + jLabel8.setFont(jLabel8.getFont().deriveFont(jLabel8.getFont().getStyle() | java.awt.Font.BOLD)); + jLabel8.setText(LOCAL.getString("label_ip")); // NOI18N + + jLabelGuardNick.setText(LOCAL.getString("textfield_unknown")); // NOI18N + jLabelGuardNick.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("resources/MessagesBundle"); // NOI18N + jLabelGuardIP.setText(bundle.getString("textfield_unknown")); // NOI18N + jLabelGuardIP.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabel9.setFont(jLabel9.getFont().deriveFont(jLabel9.getFont().getStyle() | java.awt.Font.BOLD)); + jLabel9.setText(LOCAL.getString("label_country")); // NOI18N + + jLabelGuardCountry.setText(bundle.getString("textfield_unknown")); // NOI18N + jLabelGuardCountry.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabel12.setFont(jLabel12.getFont().deriveFont(jLabel12.getFont().getStyle() | java.awt.Font.BOLD)); + jLabel12.setText(LOCAL.getString("label_nickname")); // NOI18N + + jLabelExitNick.setText(LOCAL.getString("textfield_unknown")); // NOI18N + jLabelExitNick.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabelExitIP.setText(bundle.getString("textfield_unknown")); // NOI18N + jLabelExitIP.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabelMiddle.setFont(jLabelMiddle.getFont().deriveFont(jLabelMiddle.getFont().getStyle() | java.awt.Font.BOLD)); + jLabelMiddle.setText(LOCAL.getString("label_middle")); // NOI18N + + jLabelExit.setFont(jLabelExit.getFont().deriveFont(jLabelExit.getFont().getStyle() | java.awt.Font.BOLD)); + jLabelExit.setText(LOCAL.getString("label_exit")); // NOI18N + + jLabelMiddleNick.setText(bundle.getString("textfield_unknown")); // NOI18N + jLabelMiddleNick.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabelMiddleIP.setText(bundle.getString("textfield_unknown")); // NOI18N + jLabelMiddleIP.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabelMiddleCountry.setText(bundle.getString("textfield_unknown")); // NOI18N + jLabelMiddleCountry.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jButtonExitNodeDetails.setText(LOCAL.getString("button_details")); // NOI18N + jButtonExitNodeDetails.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonExitNodeDetailsActionPerformed(evt); + } + }); + + jButtonGuardNodeDetails.setText(LOCAL.getString("button_details")); // NOI18N + jButtonGuardNodeDetails.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonGuardNodeDetailsActionPerformed(evt); + } + }); + + jButtonMiddleNodeDetails.setText(LOCAL.getString("button_details")); // NOI18N + jButtonMiddleNodeDetails.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonMiddleNodeDetailsActionPerformed(evt); + } + }); + + jLabelMiddleBw.setText(LOCAL.getString("textfield_unknown")); // NOI18N + jLabelMiddleBw.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabelExitBw.setText(LOCAL.getString("textfield_unknown")); // NOI18N + jLabelExitBw.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabelMiddleStable.setText(LOCAL.getString("textfield_unknown")); // NOI18N + jLabelMiddleStable.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabelExitStable.setText(LOCAL.getString("textfield_unknown")); // NOI18N + jLabelExitStable.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabelExitCountry.setText(bundle.getString("textfield_unknown")); // NOI18N + jLabelExitCountry.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabel4.setFont(jLabel4.getFont().deriveFont(jLabel4.getFont().getStyle() | java.awt.Font.BOLD)); + jLabel4.setText(LOCAL.getString("label_torlatency")); // NOI18N + + jLabelTorLatency.setText(LOCAL.getString("textfield_unknown")); // NOI18N + jLabelTorLatency.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabelStreams.setText(LOCAL.getString("textfield_unknown")); // NOI18N + jLabelStreams.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + jLabel6.setFont(jLabel6.getFont().deriveFont(jLabel6.getFont().getStyle() | java.awt.Font.BOLD)); + jLabel6.setText(LOCAL.getString("label_streams")); // NOI18N + + javax.swing.GroupLayout jPanelNodeInfoLayout = new javax.swing.GroupLayout(jPanelNodeInfo); + jPanelNodeInfo.setLayout(jPanelNodeInfoLayout); + jPanelNodeInfoLayout.setHorizontalGroup( + jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelNodeInfoLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel10) + .addComponent(jLabel9) + .addComponent(jLabel8) + .addComponent(jLabel12) + .addComponent(jLabel5)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanelNodeInfoLayout.createSequentialGroup() + .addComponent(jLabelGuard) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonGuardNodeDetails)) + .addComponent(jLabelGuardIP, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelGuardCountry, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelGuardBw, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelGuardStable, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelGuardNick, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanelNodeInfoLayout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabelTorLatency, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanelNodeInfoLayout.createSequentialGroup() + .addComponent(jLabelMiddle) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonMiddleNodeDetails)) + .addComponent(jLabelMiddleIP, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelMiddleCountry, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelMiddleBw, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelMiddleStable, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelMiddleNick, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jLabelExitStable, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelExitBw, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelExitCountry, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addComponent(jLabelExitIP, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelNodeInfoLayout.createSequentialGroup() + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabelStreams, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanelNodeInfoLayout.createSequentialGroup() + .addComponent(jLabelExit) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonExitNodeDetails)) + .addComponent(jLabelExitNick, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)) + .addContainerGap()) + ); + + jPanelNodeInfoLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel10, jLabel12, jLabel5, jLabel8, jLabel9}); + + jPanelNodeInfoLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabelExitBw, jLabelExitCountry, jLabelExitIP, jLabelExitNick, jLabelExitStable, jLabelMiddleBw, jLabelMiddleCountry, jLabelMiddleIP, jLabelMiddleStable}); + + jPanelNodeInfoLayout.setVerticalGroup( + jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelNodeInfoLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(jLabelGuard) + .addComponent(jButtonGuardNodeDetails) + .addComponent(jLabelMiddle) + .addComponent(jButtonMiddleNodeDetails) + .addComponent(jLabelExit) + .addComponent(jButtonExitNodeDetails)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelNodeInfoLayout.createSequentialGroup() + .addComponent(jLabelExitNick) + .addGap(0, 0, 0) + .addComponent(jLabelExitIP) + .addGap(0, 0, 0) + .addComponent(jLabelExitCountry) + .addGap(0, 0, 0) + .addComponent(jLabelExitBw) + .addGap(0, 0, 0) + .addComponent(jLabelExitStable)) + .addGroup(jPanelNodeInfoLayout.createSequentialGroup() + .addComponent(jLabelMiddleNick) + .addGap(0, 0, 0) + .addComponent(jLabelMiddleIP) + .addGap(0, 0, 0) + .addComponent(jLabelMiddleCountry) + .addGap(0, 0, 0) + .addComponent(jLabelMiddleBw) + .addGap(0, 0, 0) + .addComponent(jLabelMiddleStable)) + .addGroup(jPanelNodeInfoLayout.createSequentialGroup() + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabelGuardNick) + .addComponent(jLabel12)) + .addGap(0, 0, 0) + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabelGuardIP) + .addComponent(jLabel8)) + .addGap(0, 0, 0) + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel9) + .addComponent(jLabelGuardCountry)) + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(jLabelGuardBw)) + .addGap(0, 0, 0) + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabelGuardStable) + .addComponent(jLabel10)))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanelNodeInfoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabelStreams, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabelTorLatency, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING)) + .addContainerGap()) + ); + + jPanelNodeInfoLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabelExitBw, jLabelExitCountry, jLabelExitIP, jLabelExitNick, jLabelExitStable, jLabelGuardBw, jLabelGuardCountry, jLabelGuardIP, jLabelGuardNick, jLabelGuardStable, jLabelMiddleBw, jLabelMiddleCountry, jLabelMiddleIP, jLabelMiddleNick, jLabelMiddleStable}); + + jButtonSetGuards.setText(LOCAL.getString("button_setguards")); // NOI18N + jButtonSetGuards.setToolTipText(LOCAL.getString("button_setguards")); // NOI18N + jButtonSetGuards.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonSetGuardsActionPerformed(evt); + } + }); + + jLabStatus.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabStatus.setText(LOCAL.getString("textfield_unknown")); // NOI18N + + jButtonClearFavs.setText(LOCAL.getString("button_clearfavs")); // NOI18N + jButtonClearFavs.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonClearFavsActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanelMainLayout = new javax.swing.GroupLayout(jPanelMain); + jPanelMain.setLayout(jPanelMainLayout); + jPanelMainLayout.setHorizontalGroup( + jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelMainLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jScrollPaneExitNodes) + .addComponent(jPanelNodeInfo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanelMainLayout.createSequentialGroup() + .addGroup(jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelMainLayout.createSequentialGroup() + .addComponent(jComboCountry, javax.swing.GroupLayout.PREFERRED_SIZE, 260, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jButtonSetGuards) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jButtonClearFavs)) + .addComponent(jLabelCountry)) + .addGap(0, 0, Short.MAX_VALUE))) + .addContainerGap()) + ); + jPanelMainLayout.setVerticalGroup( + jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelMainLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabelCountry) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jComboCountry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButtonSetGuards) + .addComponent(jButtonClearFavs)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPaneExitNodes, javax.swing.GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanelNodeInfo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabStatus) + .addContainerGap()) + ); + + jMenuMenu.setMnemonic(LOCAL.getString("menu_menu").charAt(0)); + jMenuMenu.setText(LOCAL.getString("menu_menu")); // NOI18N + + jMenuItemPrefs.setMnemonic('P'); + jMenuItemPrefs.setText(LOCAL.getString("menu_prefs")); // NOI18N + jMenuItemPrefs.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemPrefsActionPerformed(evt); + } + }); + jMenuMenu.add(jMenuItemPrefs); + + jMenuItemAddPattern.setText(LOCAL.getString("menu_quickadd")); // NOI18N + jMenuItemAddPattern.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemAddPatternActionPerformed(evt); + } + }); + jMenuMenu.add(jMenuItemAddPattern); + + jMenuItemPatternEdit.setText(LOCAL.getString("menu_patternedit")); // NOI18N + jMenuItemPatternEdit.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemPatternEditActionPerformed(evt); + } + }); + jMenuMenu.add(jMenuItemPatternEdit); + + jMenuItemStdout.setText(LOCAL.getString("menu_tormonitor")); // NOI18N + jMenuItemStdout.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemStdoutActionPerformed(evt); + } + }); + jMenuMenu.add(jMenuItemStdout); + + jMenuItemExport.setText(LOCAL.getString("menu_export")); // NOI18N + jMenuItemExport.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemExportActionPerformed(evt); + } + }); + jMenuMenu.add(jMenuItemExport); + + jMenuItemImport.setText(LOCAL.getString("menu_import")); // NOI18N + jMenuItemImport.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemImportActionPerformed(evt); + } + }); + jMenuMenu.add(jMenuItemImport); + + jMenuItemGeoip.setText(LOCAL.getString("menu_geoip")); // NOI18N + jMenuItemGeoip.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemGeoipActionPerformed(evt); + } + }); + jMenuMenu.add(jMenuItemGeoip); + + jMenuItemQuit.setMnemonic('Q'); + jMenuItemQuit.setText(LOCAL.getString("menu_quit")); // NOI18N + jMenuItemQuit.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemQuitActionPerformed(evt); + } + }); + jMenuMenu.add(jMenuItemQuit); + + jMenuBar.add(jMenuMenu); + + jMenuProxy.setMnemonic(LOCAL.getString("menu_proxy").charAt(0)); + jMenuProxy.setText(LOCAL.getString("menu_proxy")); // NOI18N + + jCheckProxyDisable.setText(LOCAL.getString("combo_proxymode1")); // NOI18N + jCheckProxyDisable.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jCheckProxyDisableItemStateChanged(evt); + } + }); + jMenuProxy.add(jCheckProxyDisable); + + jCheckProxyByPattern.setText(LOCAL.getString("combo_proxymode2")); // NOI18N + jCheckProxyByPattern.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jCheckProxyByPatternItemStateChanged(evt); + } + }); + jMenuProxy.add(jCheckProxyByPattern); + + jCheckProxyAll.setText(LOCAL.getString("combo_proxymode3")); // NOI18N + jCheckProxyAll.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + jCheckProxyAllItemStateChanged(evt); + } + }); + jMenuProxy.add(jCheckProxyAll); + + jMenuBar.add(jMenuProxy); + + jMenuHelp.setMnemonic(LOCAL.getString("menu_help").charAt(0)); + jMenuHelp.setText(LOCAL.getString("menu_help")); // NOI18N + + jMenuItemDebugLog.setVisible(false); + jMenuItemDebugLog.setText(LOCAL.getString("menu_debuglog")); // NOI18N + jMenuItemDebugLog.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemDebugLogActionPerformed(evt); + } + }); + jMenuHelp.add(jMenuItemDebugLog); + + jMenuItemHelp.setMnemonic('C'); + jMenuItemHelp.setText(LOCAL.getString("menu_helpcontents")); // NOI18N + jMenuItemHelp.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemHelpActionPerformed(evt); + } + }); + jMenuHelp.add(jMenuItemHelp); + + jMenuItemTorMan.setText(LOCAL.getString("menu_tormanual")); // NOI18N + jMenuItemTorMan.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemTorManActionPerformed(evt); + } + }); + jMenuHelp.add(jMenuItemTorMan); + + jMenuItemTorCheck.setMnemonic('T'); + jMenuItemTorCheck.setText(LOCAL.getString("menu_torcheck")); // NOI18N + jMenuItemTorCheck.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemTorCheckActionPerformed(evt); + } + }); + jMenuHelp.add(jMenuItemTorCheck); + + jMenuItemAbout.setMnemonic('A'); + jMenuItemAbout.setText(LOCAL.getString("menu_about")); // NOI18N + jMenuItemAbout.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemAboutActionPerformed(evt); + } + }); + jMenuHelp.add(jMenuItemAbout); + + jMenuItemLicense.setText(LOCAL.getString("menu_license")); // NOI18N + jMenuItemLicense.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItemLicenseActionPerformed(evt); + } + }); + jMenuHelp.add(jMenuItemLicense); + + jMenuBar.add(jMenuHelp); + + setJMenuBar(jMenuBar); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanelMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanelMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + + pack(); + }// //GEN-END:initComponents + + private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing + if (sp.getBool("PREF_MINONCLOSE")) { + // Used to provide clean shut down when a WM_CLOSE and Taskkill are called + // posted externally + if (!isVisible() && OSFunction.isWindows()) { + cleanupExit(); + return; + } + if (sp.getBool("PREF_HIDE_MIN") && sti.isLoaded()) { + setVisible(false); + } else { + setExtendedState(Frame.ICONIFIED); + } + } else { + cleanupExit(); + } + }//GEN-LAST:event_formWindowClosing + + private void jComboCountryItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboCountryItemStateChanged + + switch (evt.getStateChange()) { + case ItemEvent.DESELECTED: + abortTesting(); + break; + case ItemEvent.SELECTED: + countryChanged(); + break; + } + + }//GEN-LAST:event_jComboCountryItemStateChanged + + private void jMenuItemPrefsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPrefsActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + openPreferencesDialog(); + } + }); + }//GEN-LAST:event_jMenuItemPrefsActionPerformed + + private void jMenuItemAddPatternActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAddPatternActionPerformed + openQuickAddDialog(); + }//GEN-LAST:event_jMenuItemAddPatternActionPerformed + + private void jMenuItemPatternEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemPatternEditActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + openPatternEditorDialog(); + } + }); + }//GEN-LAST:event_jMenuItemPatternEditActionPerformed + + private void jMenuItemImportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemImportActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + openPatternImport(); + } + }); + }//GEN-LAST:event_jMenuItemImportActionPerformed + + private void jMenuItemQuitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemQuitActionPerformed + cleanupExit(); + }//GEN-LAST:event_jMenuItemQuitActionPerformed + + private void jMenuItemDebugLogActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemDebugLogActionPerformed + Utilities.editFile(settingsPath + "status.log"); + }//GEN-LAST:event_jMenuItemDebugLogActionPerformed + + private void jMenuItemHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemHelpActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + Utilities.openFileExternally(DOCSPATH + "help-" + OSFunction.getLangCode() + ".html"); + } + }); + }//GEN-LAST:event_jMenuItemHelpActionPerformed + + private void jMenuItemTorCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemTorCheckActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + String link = TORCHECK + "?lang=" + + LOCAL.toWebLanguageTag(); + Utilities.openFileExternally(link); + } + }); + }//GEN-LAST:event_jMenuItemTorCheckActionPerformed + + private void jMenuItemAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemAboutActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + openAboutDialog(); + } + }); + }//GEN-LAST:event_jMenuItemAboutActionPerformed + + private void jMenuItemLicenseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemLicenseActionPerformed + openLicenseDialog(); + }//GEN-LAST:event_jMenuItemLicenseActionPerformed + + private void jMenuWhoisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuWhoisActionPerformed + String finger = (String) entm.getValueAt(intRowSelected, 5); + NodeItem ni = nodeList.getNode(finger); + if (ni != null) { + Utilities.openFileExternally("https://www.networksolutions.com/whois/results.jsp?ip=" + ni.getIPAddress()); + } + }//GEN-LAST:event_jMenuWhoisActionPerformed + + private void jMenuTestingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuTestingActionPerformed + abortTesting(); + intBeginTesting = 4; + }//GEN-LAST:event_jMenuTestingActionPerformed + + private void popupTablePopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_popupTablePopupMenuWillBecomeVisible + jMenuWhois.setEnabled(intRowSelected > -1); + jMenuNodeDetails.setEnabled(intRowSelected > -1); + }//GEN-LAST:event_popupTablePopupMenuWillBecomeVisible + + private void jMenuNodeDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuNodeDetailsActionPerformed + String finger = (String) entm.getValueAt(intRowSelected, 5); + finger = finger.replace("$", EMPTYSTR); + Utilities.openFileExternally(ATLAS + "#details/" + finger); + }//GEN-LAST:event_jMenuNodeDetailsActionPerformed + + private void jButtonExitNodeDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonExitNodeDetailsActionPerformed + String finger = niActiveExit.getFingerprint(); + finger = finger.replace("$", EMPTYSTR); + Utilities.openFileExternally(ATLAS + "#details/" + finger); + }//GEN-LAST:event_jButtonExitNodeDetailsActionPerformed + + private void jMenuItemStdoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemStdoutActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + openTorMonitor(); + } + }); + }//GEN-LAST:event_jMenuItemStdoutActionPerformed + + private void jMenuItemTorManActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemTorManActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + Utilities.openFileExternally(TORPROJECT + "docs/tor-manual.html"); + } + }); + }//GEN-LAST:event_jMenuItemTorManActionPerformed + + private void jButtonGuardNodeDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGuardNodeDetailsActionPerformed + String finger = niActiveGuard.getFingerprint(); + finger = finger.replace("$", EMPTYSTR); + Utilities.openFileExternally(ATLAS + "#details/" + finger); + }//GEN-LAST:event_jButtonGuardNodeDetailsActionPerformed + + private void jButtonSetGuardsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSetGuardsActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + openGuardsSettingDialog(); + } + }); + }//GEN-LAST:event_jButtonSetGuardsActionPerformed + + private void jMenuItemGUIActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGUIActionPerformed + toggleGUIVisibility(); + }//GEN-LAST:event_jMenuItemGUIActionPerformed + + private void jMenuItemQuitxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemQuitxActionPerformed + cleanupExit(); + }//GEN-LAST:event_jMenuItemQuitxActionPerformed + + private void jButtonMiddleNodeDetailsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonMiddleNodeDetailsActionPerformed + String finger = niActiveMiddle.getFingerprint(); + finger = finger.replace("$", EMPTYSTR); + Utilities.openFileExternally(ATLAS + "#details/" + finger); + }//GEN-LAST:event_jButtonMiddleNodeDetailsActionPerformed + + private void jMenuItemExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemExportActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + openPatternExport(); + } + }); + }//GEN-LAST:event_jMenuItemExportActionPerformed + + private void jCheckProxyDisableItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckProxyDisableItemStateChanged + if (evt.getStateChange() == ItemEvent.SELECTED) { + jCheckTrayProxyDisable.setSelected(true); + if (jCheckProxyDisable.isEnabled()) { + proxyModeChanged(PacFactory.PROXY_DISABLED); + } + } + }//GEN-LAST:event_jCheckProxyDisableItemStateChanged + + private void jCheckProxyByPatternItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckProxyByPatternItemStateChanged + if (evt.getStateChange() == ItemEvent.SELECTED) { + jCheckTrayProxyByPattern.setSelected(true); + if (jCheckProxyByPattern.isEnabled()) { + proxyModeChanged(PacFactory.PROXY_PATTERN); + } + } + }//GEN-LAST:event_jCheckProxyByPatternItemStateChanged + + private void jCheckProxyAllItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckProxyAllItemStateChanged + if (evt.getStateChange() == ItemEvent.SELECTED) { + jCheckTrayProxyAll.setSelected(true); + if (jCheckProxyAll.isEnabled()) { + proxyModeChanged(PacFactory.PROXY_ALL); + } + } + }//GEN-LAST:event_jCheckProxyAllItemStateChanged + + private void jCheckTrayProxyDisableItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckTrayProxyDisableItemStateChanged + if (evt.getStateChange() == ItemEvent.SELECTED) { + jCheckProxyDisable.setSelected(true); + } + }//GEN-LAST:event_jCheckTrayProxyDisableItemStateChanged + + private void jCheckTrayProxyByPatternItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckTrayProxyByPatternItemStateChanged + if (evt.getStateChange() == ItemEvent.SELECTED) { + jCheckProxyByPattern.setSelected(true); + } + }//GEN-LAST:event_jCheckTrayProxyByPatternItemStateChanged + + private void jCheckTrayProxyAllItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCheckTrayProxyAllItemStateChanged + if (evt.getStateChange() == ItemEvent.SELECTED) { + jCheckProxyAll.setSelected(true); + } + }//GEN-LAST:event_jCheckTrayProxyAllItemStateChanged + + private void jMenuItemGeoipActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGeoipActionPerformed + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + updateGeoip(); + } + }); + }//GEN-LAST:event_jMenuItemGeoipActionPerformed + + private void jButtonClearFavsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClearFavsActionPerformed + clearFavourites(); + }//GEN-LAST:event_jButtonClearFavsActionPerformed + + private void jTableExitNodesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableExitNodesMouseClicked + if (evt.getButton() != MouseEvent.BUTTON1) { + return; + } + try { + // Get row selection + intRowSelected = jTableExitNodes.getSelectedRow(); + if (intRowSelected > -1) { + intRowSelected = jTableExitNodes.convertRowIndexToModel(intRowSelected); + } + } catch (Exception ex) { + } + }//GEN-LAST:event_jTableExitNodesMouseClicked + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.ButtonGroup buttonGroupProxy; + private javax.swing.ButtonGroup buttonGroupProxyTray; + private javax.swing.JButton jButtonClearFavs; + private javax.swing.JButton jButtonExitNodeDetails; + private javax.swing.JButton jButtonGuardNodeDetails; + private javax.swing.JButton jButtonMiddleNodeDetails; + private javax.swing.JButton jButtonSetGuards; + private javax.swing.JCheckBoxMenuItem jCheckProxyAll; + private javax.swing.JCheckBoxMenuItem jCheckProxyByPattern; + private javax.swing.JCheckBoxMenuItem jCheckProxyDisable; + private javax.swing.JCheckBoxMenuItem jCheckTrayProxyAll; + private javax.swing.JCheckBoxMenuItem jCheckTrayProxyByPattern; + private javax.swing.JCheckBoxMenuItem jCheckTrayProxyDisable; + private javax.swing.JComboBox jComboCountry; + private javax.swing.JLabel jLabStatus; + private javax.swing.JLabel jLabel10; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel8; + private javax.swing.JLabel jLabel9; + private javax.swing.JLabel jLabelCountry; + private javax.swing.JLabel jLabelExit; + private javax.swing.JLabel jLabelExitBw; + private javax.swing.JLabel jLabelExitCountry; + private javax.swing.JLabel jLabelExitIP; + private javax.swing.JLabel jLabelExitNick; + private javax.swing.JLabel jLabelExitStable; + private javax.swing.JLabel jLabelGuard; + private javax.swing.JLabel jLabelGuardBw; + private javax.swing.JLabel jLabelGuardCountry; + private javax.swing.JLabel jLabelGuardIP; + private javax.swing.JLabel jLabelGuardNick; + private javax.swing.JLabel jLabelGuardStable; + private javax.swing.JLabel jLabelMiddle; + private javax.swing.JLabel jLabelMiddleBw; + private javax.swing.JLabel jLabelMiddleCountry; + private javax.swing.JLabel jLabelMiddleIP; + private javax.swing.JLabel jLabelMiddleNick; + private javax.swing.JLabel jLabelMiddleStable; + private javax.swing.JLabel jLabelStreams; + private javax.swing.JLabel jLabelTorLatency; + private javax.swing.JMenuBar jMenuBar; + private javax.swing.JMenu jMenuHelp; + private javax.swing.JMenuItem jMenuItemAbout; + private javax.swing.JMenuItem jMenuItemAddPattern; + private javax.swing.JMenuItem jMenuItemDebugLog; + private javax.swing.JMenuItem jMenuItemExport; + private javax.swing.JMenuItem jMenuItemGUI; + private javax.swing.JMenuItem jMenuItemGeoip; + private javax.swing.JMenuItem jMenuItemHelp; + private javax.swing.JMenuItem jMenuItemImport; + private javax.swing.JMenuItem jMenuItemLicense; + private javax.swing.JMenuItem jMenuItemPatternEdit; + private javax.swing.JMenuItem jMenuItemPrefs; + private javax.swing.JMenuItem jMenuItemQuit; + private javax.swing.JMenuItem jMenuItemQuitx; + private javax.swing.JMenuItem jMenuItemStdout; + private javax.swing.JMenuItem jMenuItemTorCheck; + private javax.swing.JMenuItem jMenuItemTorMan; + private javax.swing.JMenu jMenuMenu; + private javax.swing.JMenuItem jMenuNodeDetails; + private javax.swing.JMenu jMenuProxy; + private javax.swing.JMenuItem jMenuTesting; + private javax.swing.JMenuItem jMenuWhois; + private javax.swing.JPanel jPanelMain; + private javax.swing.JPanel jPanelNodeInfo; + private javax.swing.JScrollPane jScrollPaneExitNodes; + private javax.swing.JTable jTableExitNodes; + private javax.swing.JPopupMenu popupTable; + // End of variables declaration//GEN-END:variables +} diff --git a/src/client/TorCircuit.java b/src/client/TorCircuit.java new file mode 100644 index 0000000..f0c7d36 --- /dev/null +++ b/src/client/TorCircuit.java @@ -0,0 +1,236 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import java.util.regex.Pattern; + +/** + * + * @author Alistair Neil + */ +public final class TorCircuit { + + public static final int FINGER = 0; + public static final int NICKNAME = 1; + private String[] dataCirc; + private String[] dataHops; + private String circuitinfo; + + /** + * Constructor + */ + public TorCircuit() { + } + + /** + * Constructor, Create circuit object with given circuit + * + * @param circuit + */ + public TorCircuit(String circuit) { + setCircuit(circuit); + } + + /** + * Set circuit to supplied circuit + * + * @param circuit + */ + public void setCircuit(String circuit) { + circuitinfo = circuit; + Pattern pattern = Pattern.compile(" "); + dataCirc = pattern.split(circuit); + setHops(dataCirc[2]); + } + + /** + * Get circuit + * + * @return circuit as string + */ + public String getCircuit() { + return circuitinfo; + } + + /** + * Set hops + * + * @param hops + */ + public void setHops(String hops) { + Pattern pattern = Pattern.compile(","); + dataHops = pattern.split(hops); + } + + /** + * Get current circuit ID + * + * @return ID as string + */ + public String getID() { + return dataCirc[0]; + } + + /** + * Get current circuit status + * + * @return status as string + */ + public String getStatus() { + return dataCirc[1]; + } + + /** + * Get current circuits build flags + * + * @return build flags as string + */ + public String getBuildFlags() { + return dataCirc[3].substring(12); + } + + /** + * Get current circuits purpose + * + * @return purpose as string + */ + public String getPurpose() { + return dataCirc[4].substring(8); + } + + /** + * Get current circuits timestamp + * + * @return timestamp as string + */ + public String getTimestamp() { + return dataCirc[5].substring(13); + } + + /** + * Get circuit hops + * + * @return circuit hops as string + */ + public String getHops() { + return dataCirc[2]; + } + + /** + * Get current circuits guard or entry node + * + * @return guard node as string + */ + public String getGuardHop() { + String result = null; + try { + result = dataHops[0]; + } catch (Exception ex) { + } + return result; + } + + /** + * Get current circuits middle node if any, returns exit node for a two hop + * circuit + * + * @return middleman node as string + */ + public String getMiddleHop() { + String result = null; + try { + if (dataHops.length < 3) { + result = ""; + } else { + result = dataHops[1]; + } + } catch (Exception ex) { + } + return result; + } + + /** + * Get current circuits exit node + * + * @return exit node as string + */ + public String getExitHop() { + String result = null; + try { + result = dataHops[dataHops.length - 1]; + } catch (Exception ex) { + } + return result; + } + + /** + * Get Guardnode finger or nick + * + * @param type 0 = finger, 1 = nick + * @return fingerprint as string + */ + public String getGuard(int type) { + return getFromNodeHop(getGuardHop(), type); + } + + /** + * Get Middleman + * + * @param type 0 = finger, 1 = nick + * @return fingerprint as string + */ + public String getMiddleMan(int type) { + return getFromNodeHop(getMiddleHop(), type); + } + + /** + * Get Exitnode + * + * @param type 0 = finger, 1 = nick + * @return fingerprint as string + */ + public String getExit(int type) { + return getFromNodeHop(getExitHop(), type); + } + + /** + * Get fingerprint of given node Nodeinfo is in the format of + * fingerprint~name or fingerprint=name + * + * @param nodeinfo + * @param type 0 = finger, 1 = nickname + * @return fingerprint as string + */ + public static String getFromNodeHop(String nodeinfo, int type) { + Pattern pattern; + try { + if (nodeinfo.contains("~")) { + pattern = Pattern.compile("~"); + } else { + pattern = Pattern.compile("="); + } + String[] result = pattern.split(nodeinfo); + if (result.length > 0) { + return result[type]; + } + } catch (Exception ex) { + } + return null; + } + +} diff --git a/src/client/TorController.java b/src/client/TorController.java new file mode 100644 index 0000000..e64034f --- /dev/null +++ b/src/client/TorController.java @@ -0,0 +1,1165 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import java.io.BufferedReader; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.net.Socket; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Pattern; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import lib.SimpleFile; + +/** + * + * @author Alistair Neil + */ +public class TorController extends TorProcess { + + // Event constants, which supplement the ones provide by TorProcess + public static final int EVENT_CIRCUITS_BUILT = 15; + public static final int EVENT_CIRCUITS_FAILED = 16; + public static final int EVENT_CIRCUIT_BUILT = 17; + public static final int EVENT_CIRCUIT_FAILED = 18; + public static final int EVENT_LATENCY_DONE = 19; + public static final int EVENT_TESTING_DONE = 20; + public static final int EVENT_CIRCUIT_CHANGED = 21; + public static final int EVENT_ABORTED = 22; + private static final String LOCALHOST = "127.0.0.1"; + private static final String[] EVENTMESSAGES = new String[]{ + "EVENT_CIRCUITS_BUILT", "EVENT_CIRCUITS_FAILED", "EVENT_CIRCUIT_BUILT", + "EVENT_CIRCUIT_FAILED", "EVENT_LATENCY_DONE", "EVENT_TESTING_DONE", + "EVENT_CIRCUIT_CHANGED", "EVENT_ABORTED" + }; + + // Status constants + public static final int STATUS_DEAD = 0; + public static final int STATUS_BOOTING = 1; + public static final int STATUS_IDLE = 2; + public static final int STATUS_CIRCUIT_CREATION = 3; + public static final int STATUS_LATENCY_CHECKING = 4; + + // Other constants + public static final long LATENCY_FAIL = 9999; + public static final int STREAM_IP = 5; + public static final int NODE_GUARD = 0; + public static final int NODE_MIDDLE = 1; + public static final int NODE_EXIT = 2; + private static final int DEFBUILDTIME = 60; + + private volatile Socket sockControl; + private volatile BufferedReader brSocket; + private volatile PrintWriter pwSocket; + private String strLatencyURL; + private final ConcurrentHashMap chmUseableCircuits; + private ArrayList alActiveStreams; + private int intStatus = STATUS_DEAD; + private volatile Socket sockProxy; + private long lngLatency; + private String strBestHops; + private long lngBestLatency; + private String entrynodes = ""; + private Thread tActive; + private boolean haveEntryNode; + + /** + * Constructor + * + * @param clientpath Path to Tor client + * @param configfolder Location of configuration file torrc + */ + public TorController(String clientpath, String configfolder) { + super(clientpath, configfolder); + this.chmUseableCircuits = new ConcurrentHashMap<>(); + this.alActiveStreams = new ArrayList<>(); + } + + /** + * Tor process event + * + * @param event + * @param data + */ + @Override + public final void torProcessEventFired(int event, String data) { + + Logger.getGlobal().logp(Level.FINE, TorProcess.class.getName(), + "torProcessEventFired() on Port=" + getListenPort(), getEventMessage(event) + ", Data=" + data); + + switch (event) { + case TOR_BRIDGE: + haveEntryNode = true; + break; + case TOR_STOPPED: + setStatus(STATUS_DEAD); + break; + case TOR_BOOTED: + case TOR_RESTARTED: + openControlSocket(); + // Authenticate our control + authenticateTor(getSecret()); + takeOwnership(); + waitForBridgeNodes(DEFBUILDTIME); + setStatus(STATUS_IDLE); + break; + } + controllerEventFired(event, data); + } + + @Override + public String getEventMessage(int event) { + if (event < EVENT_CIRCUITS_BUILT) { + return super.getEventMessage(event); + } else { + return EVENTMESSAGES[event - EVENT_CIRCUITS_BUILT]; + } + } + + /** + * Handle for controllerEventFired should be overridden by parent class + * + * @param event + * @param data + */ + public void controllerEventFired(int event, Object data) { + } + + /** + * Set status flag + * + * @param status + */ + public synchronized void setStatus(int status) { + intStatus = status; + } + + /** + * Get current status + * + * @return status integer constant, see defined status constants + */ + public synchronized int getStatus() { + return intStatus; + } + + /** + * Convenience test for idle status + * + * @return true if idle + */ + public boolean isIdle() { + return (getStatus() <= STATUS_IDLE); + } + + /** + * Stop the tor controller process completely + * + */ + public final void stop() { + haveEntryNode = false; + abortActions(); + Logger.getGlobal().logp(Level.INFO, TorController.class.getName(), + "stop() on Port=" + getListenPort(), "Stop requested"); + sendCommand("QUIT"); + closeControlSocket(); + stopProcess(); + setStatus(STATUS_DEAD); + } + + /** + * Start tor controller process and issue the TOR_BOOTED event + * + */ + public final void start() { + createDefaultConfig(); + start(TOR_BOOTED); + } + + /** + * Start tor controller process and issue the given event + * + * @param bootevent + */ + public final void start(int bootevent) { + if (getStatus() == STATUS_DEAD) { + setInitialBootEvent(bootevent); + setStatus(STATUS_BOOTING); + startProcess(); + return; + } + if (getStatus() > STATUS_BOOTING) { + setStatus(STATUS_IDLE); + controllerEventFired(bootevent, null); + } + } + + /** + * Abort all current actions + */ + public final void abortActions() { + if (getStatus() < STATUS_IDLE) { + return; + } + setStatus(STATUS_IDLE); + // Abort latency checking + abortLatencyCheck(); + // Interrupt sleep thread if active + Thread t = getActiveThread(); + if (t != null) { + t.interrupt(); + } + } + + /** + * Abort latency checking + */ + public final void abortLatencyCheck() { + // Kill off latency checking proxy socket + if (sockProxy != null) { + try { + sockProxy.close(); + } catch (IOException ex) { + } + } + sockProxy = null; + } + + /** + * Save configuration file + */ + public void saveConf() { + SimpleFile sf = new SimpleFile(getConfigFilePath()); + sf.delete(); + sendCommand("SAVECONF"); + } + + /** + * Load configuration file + */ + public void loadConf() { + SimpleFile sf = new SimpleFile(getConfigFilePath()); + sf.openBufferedRead(); + String text = sf.readEntireFile(); + sf.closeFile(); + sendCommand("+loadconf\r\n" + text + "\r\n."); + } + + /** + * Attempts to return the Country associated with an ip address + * + * @param ip + * @return Country or null if not found + */ + public String getCountryFromIP(String ip) { + // Get country from ip address + String cmd = "ip-to-country/" + ip; + ArrayList infoList = getInfo(cmd); + try { + if (infoList != null) { + return infoList.get(0).toUpperCase(); + } + } catch (Exception ex) { + } + return null; + } + + /** + * Set the url used for latency checking + * + * @param url + */ + public void setTestingURL(String url) { + strLatencyURL = url; + } + + /** + * Take ownership of the Tor client process so that it shuts down if the + * process is destroyed, particular useful for linux desktops that dont + * issue proper terminations. + */ + private void takeOwnership() { + sendCommand("TAKEOWNERSHIP"); + sendCommand("RESETCONF __OwningControllerProcess"); + } + + /** + * Authenticate a password protected tor control socket + * + * @param password + */ + private void authenticateTor(String password) { + if (password == null) { + sendCommand("AUTHENTICATE"); + } else { + sendCommand("AUTHENTICATE " + "\"" + password + "\""); + } + } + + /** + * Enable/Disable predictive circuit building + * + * @param enabled + */ + public void enablePredictiveCircuits(boolean enabled) { + if (enabled) { + setConf("__DisablePredictedCircuits=0"); + } else { + setConf("__DisablePredictedCircuits=1"); + } + } + + /** + * Get tor status information for a given property. See TOR control-spec + * documentation for valid properties + * + * @param property + * @return Arraylist containg the result of the command + */ + public final ArrayList getInfo(String property) { + return sendCommand("GETINFO " + property); + } + + /** + * Close a circuit with ID + * + * @param id + */ + public final void closeCircuit(String id) { + sendCommand("CLOSECIRCUIT " + id); + } + + /** + * Set a tor configuration property + * + * @param property + * @return Arraylist containg the result of the command + */ + public final ArrayList setConf(String property) { + return sendCommand("SETCONF " + property); + } + + /** + * reset a tor configuration property + * + * @param property + * @return Arraylist containing the result of the command + */ + public final ArrayList resetConf(String property) { + return sendCommand("RESETCONF " + property); + } + + /** + * Send signal to tor + * + * @param cmd + * @return Arraylist containing the result of the command + */ + public final ArrayList signal(String cmd) { + return sendCommand("SIGNAL " + cmd); + } + + /** + * Get entry guards chosen by tor client + * + * @return entry guards as comma separated fingerprints + */ + public String getEntryGuardsAsCSV() { + ArrayList al = getInfo("entry-guards"); + StringBuilder sbResult = new StringBuilder(); + if (!al.contains("250 OK")) { + return sbResult.toString(); + } + // Remove 250 OK entry + al.remove("250 OK"); + String sep = ""; + for (String s : al) { + if (s.contains("~")) { + sbResult.append(sep); + sbResult.append(s.substring(0, s.indexOf('~'))); + if (sep.isEmpty()) { + sep = ","; + } + } + } + return sbResult.toString(); + } + + /** + * Triggers a socks latency check, EVENT_LATENCY_CHECK is fired on + * completion + * + * @param timeout + */ + public final void doLatencyCheck(final int timeout) { + + Thread t = new Thread(new java.lang.Runnable() { + long latency; + + @Override + public void run() { + latency = getTorLatency(timeout); + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + lngLatency = latency; + //? controllerEventFired(EVENT_LATENCY_DONE, null); + } + }); + } + }); + if (getStatus() < STATUS_IDLE) { + return; + } + alActiveStreams = getInfo("stream-status"); + alActiveStreams.remove("250 OK"); + t.start(); + } + + /** + * Get current latency + * + * @return latency in ms as long + */ + public final long getLatency() { + return lngLatency; + } + + /** + * Returns measured latency for the active circuit without creating a + * stream, this blocks so be careful + * + * @param timeout + * @return latency + */ + public long getTorLatency(int timeout) { + long lngResult = LATENCY_FAIL; + DataInputStream dis = null; + try { + sockProxy = createTorSocketToURL(strLatencyURL, true); + if (sockProxy != null) { + sockProxy.setSoTimeout(timeout); + dis = new DataInputStream(sockProxy.getInputStream()); + long lngStart = System.currentTimeMillis(); + dis.skipBytes(1); + lngResult = System.currentTimeMillis() - lngStart; + } + } catch (IOException ex) { + Logger.getGlobal().logp(Level.INFO, TorController.class.getName(), + "getTorLatency Exception " + getListenPort(), ex.getMessage()); + } + try { + if (!sockProxy.isClosed()) { + sockProxy.close(); + } + sockProxy = null; + } catch (Exception ex) { + } + try { + if (dis != null) { + dis.close(); + } + } catch (Exception ex) { + } + return lngResult; + } + + /** + * Close open circuits except circuit specified by id + * + * @param id + * @param filtered + */ + public void closeCircuitsExcept(String id, boolean filtered) { + Logger.getGlobal().logp(Level.FINEST, TorController.class.getName(), + "closeCircuitsExcept() Port=" + getListenPort(), ""); + Set keys = getBuiltCircuits(filtered).keySet(); + Iterator i = keys.iterator(); + String hopid; + while (i.hasNext()) { + hopid = (String) i.next(); + if (!hopid.contentEquals(id)) { + closeCircuit(hopid); + } + } + } + + private String getCircuitIdFromStream(String stream) { + String data[]; + Pattern pat = Pattern.compile(" "); + data = pat.split(stream); + return data[2]; + } + + /** + * Get list of active streams + * + * @return active streams as a list + */ + public final ArrayList getActiveStreams() { + return alActiveStreams; + } + + /** + * Set the csv list of exit node fingers to be used by tor, a single exit + * node may also be specified, this does not block + * + * @param fingers + * @param nocircs + */ + public final void activateNodes(final String fingers, final int nocircs) { + + Thread t = new Thread(new java.lang.Runnable() { + + @Override + public void run() { + activateNodesBlocking(fingers, nocircs); + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + if (isIdle()) { + controllerEventFired(EVENT_ABORTED, null); + return; + } + setStatus(STATUS_IDLE); + if (chmUseableCircuits.isEmpty()) { + controllerEventFired(EVENT_CIRCUITS_FAILED, 0); + } else { + controllerEventFired(EVENT_CIRCUITS_BUILT, chmUseableCircuits.size()); + } + } + }); + + } + }); + if (getStatus() < STATUS_IDLE) { + return; + } + abortActions(); + setStatus(STATUS_CIRCUIT_CREATION); + t.start(); + } + + /** + * Activate given circuit, does not block + * + * @param hops + */ + public final void activateCircuit(final String hops) { + + Thread t = new Thread(new java.lang.Runnable() { + + @Override + public void run() { + activateCircuitBlocking(hops); + SwingUtilities.invokeLater(new java.lang.Runnable() { + @Override + public void run() { + if (isIdle()) { + controllerEventFired(EVENT_ABORTED, null); + return; + } + setStatus(STATUS_IDLE); + if (chmUseableCircuits.isEmpty()) { + controllerEventFired(EVENT_CIRCUIT_FAILED, null); + } else { + controllerEventFired(EVENT_CIRCUIT_BUILT, null); + } + } + }); + + } + }); + if (getStatus() < STATUS_IDLE) { + return; + } + setStatus(STATUS_CIRCUIT_CREATION); + t.start(); + } + + /** + * Set entry nodes + * + * @param fingers + */ + public void setEntryNodes(String fingers) { + entrynodes = ""; + if (fingers == null || !getBridges().isEmpty()) { + return; + } + entrynodes = fingers; + } + + /** + * Get configured entry nodes + * + * @return entry nodes in CSV format + */ + public String getEntryNodes() { + return entrynodes; + } + + /** + * Set the csv list of exit node fingers to be used by tor, a single exit + * node may also be specified, this blocks + * + * @param fingers + * @param nocircs + */ + public void activateNodesBlocking(String fingers, int nocircs) { + chmUseableCircuits.clear(); + enablePredictiveCircuits(true); + setConf("EntryNodes=" + entrynodes); + setConf("ExitNodes=" + fingers); + if (fingers.isEmpty() || fingers.contains("{")) { + fingers = null; + } + waitForCircuits(DEFBUILDTIME, nocircs, fingers); + enablePredictiveCircuits(false); + } + + /** + * Activate given circuit, blocks + * + * @param hops + */ + private void activateCircuitBlocking(String hops) { + chmUseableCircuits.clear(); + sendCommand("EXTENDCIRCUIT 0 " + hops + " PURPOSE=GENERAL"); + waitForCircuit(DEFBUILDTIME, hops); + } + + /** + * Wait so many seconds for valid bridges to appear if bridges are set + * + * @param secs + */ + private void waitForBridgeNodes(int secs) { + + long timeout = System.currentTimeMillis() + (secs * 1000); + while (!haveValidEntryNode()) { + try { + Thread.sleep(250); + if (System.currentTimeMillis() > timeout) { + break; + } + } catch (InterruptedException ex) { + break; + } + } + } + + public boolean haveValidEntryNode() { + if (getBridges().isEmpty()) { + return true; + } + return haveEntryNode; + } + + private void waitForCircuits(long secs, int nocircs, String reqFinger) { + + long timeout = System.currentTimeMillis() + (secs * nocircs * 1000); + setActiveThread(Thread.currentThread()); + while (chmUseableCircuits.size() < nocircs) { + try { + Thread.sleep(250); + } catch (InterruptedException ex) { + break; + } + if (System.currentTimeMillis() > timeout) { + Logger.getGlobal().logp(Level.INFO, TorController.class + .getName(), + "waitForCircuits() on Port=" + getListenPort(), "Timed Out"); + break; + } + if (isIdle()) { + Logger.getGlobal().logp(Level.INFO, TorController.class + .getName(), + "waitForCircuits() on Port=" + getListenPort(), "Aborting"); + chmUseableCircuits.clear(); + break; + } + TorCircuit tc = getLatestCircuit(); + if (tc != null) { + // If we have a node request then ensure that the circuit contains the requested node fingerprint + if (reqFinger != null && !reqFinger.contains(tc.getExit(TorCircuit.FINGER))) { + continue; + } + // If we have custom guards, then ensure circuit contains guard + if (entrynodes.isEmpty()) { + chmUseableCircuits.put(tc.getID(), tc); + } else if (entrynodes.contains(tc.getGuard(TorCircuit.FINGER))) { + chmUseableCircuits.put(tc.getID(), tc); + } + } + + } + } + + private void waitForCircuit(long secs, String reqHops) { + + long timeout = System.currentTimeMillis() + (secs * 1000); + setActiveThread(Thread.currentThread()); + while (chmUseableCircuits.size() < 1) { + try { + Thread.sleep(250); + } catch (InterruptedException ex) { + break; + } + if (System.currentTimeMillis() > timeout) { + Logger.getGlobal().logp(Level.INFO, TorController.class + .getName(), + "waitForCircuit() on Port=" + getListenPort(), "Timed Out"); + break; + } + if (isIdle()) { + Logger.getGlobal().logp(Level.INFO, TorController.class + .getName(), + "waitForCircuit() on Port=" + getListenPort(), "Aborting"); + chmUseableCircuits.clear(); + break; + } + TorCircuit tcActive = getLatestCircuit(); + if (tcActive != null) { + String hops = tcActive.getHops(); + if (hops.contains(reqHops)) { + chmUseableCircuits.put(tcActive.getID(), tcActive); + } + } + } + } + + private synchronized void setActiveThread(Thread t) { + tActive = t; + } + + private synchronized Thread getActiveThread() { + return tActive; + } + + /** + * Test specified node, non blocking + * + * @param finger + */ + public void testNode(final String finger) { + + SwingWorker sw = new SwingWorker() { + private long bestLatency = LATENCY_FAIL; + private String bestHops = null; + + @Override + protected Void doInBackground() { + closeCircuitsExcept("", true); + activateNodesBlocking(finger, 1); + if (isIdle()) { + return null; + } + if (chmUseableCircuits.size() > 0) { + String id = chmUseableCircuits.keys().nextElement(); + TorCircuit tc = chmUseableCircuits.get(id); + closeCircuitsExcept("", true); + activateCircuitBlocking(tc.getHops()); + publish(EVENT_CIRCUIT_BUILT); + long latency = getTorLatency(5000); + if (latency < bestLatency) { + bestLatency = latency; + bestHops = tc.getHops(); + } + } + return null; + } + + @Override + protected void process(List chunks) { + for (Integer i : chunks) { + controllerEventFired(i, chmUseableCircuits.size()); + } + } + + @Override + protected void done() { + if (isIdle()) { + lngBestLatency = LATENCY_FAIL; + strBestHops = null; + controllerEventFired(EVENT_ABORTED, null); + } else { + setStatus(STATUS_IDLE); + lngBestLatency = bestLatency; + strBestHops = bestHops; + controllerEventFired(EVENT_TESTING_DONE, chmUseableCircuits.size()); + } + } + + }; + setStatus(STATUS_CIRCUIT_CREATION); + strBestHops = null; + lngBestLatency = LATENCY_FAIL; + sw.execute(); + } + + /** + * Get best latency + * + * @return best latency value in ms as long + */ + public final long getBestLatency() { + return lngBestLatency; + } + + /** + * Get best hops + * + * @return hops info as string + */ + public final String getBestHops() { + return strBestHops; + } + + /** + * Get built circuits + * + * @param filtered Filter out unwanted circuits + * @return HashMap of built circuits keyed to their circuit id + */ + public final HashMap getBuiltCircuits(boolean filtered) { + HashMap hm = new HashMap<>(); + ArrayList circuits = getInfo("circuit-status"); + circuits.remove("250 OK"); + for (String circuit : circuits) { + if (circuit.contains("BUILT")) { + if (filtered) { + if (circuit.contains("ONEHOP_TUNNEL")) { + continue; + } + if (circuit.contains("IS_INTERNAL")) { + continue; + } + if (!circuit.contains("PURPOSE=GENERAL")) { + continue; + } + } + TorCircuit tc = new TorCircuit(circuit); + hm.put(tc.getID(), tc); + // Debug purposes + // if (getListenPort() == 9054) { + // System.out.println("Circuit=" + circuit); + // } + } + } + return hm; + } + + /** + * Verify we have comms on the control socket + * + * @return true if its good + */ + public final boolean verifyControlComms() { + ArrayList circuits = getInfo("circuit-status"); + return !circuits.isEmpty(); + } + + /** + * Get the latest circuit + * + * @return circuit + */ + public final TorCircuit getLatestCircuit() { + + HashMap hm = getBuiltCircuits(true); + Iterator i = getBuiltCircuits(true).keySet().iterator(); + String strId; + TorCircuit tcRecent = null; + int hid = 0; + int id; + while (i.hasNext()) { + strId = (String) i.next(); + id = Integer.parseInt(strId); + if (id > hid) { + hid = id; + tcRecent = hm.get(strId); + } + } + return tcRecent; + } + + private void openControlSocket() { + try { + sockControl = new Socket(LOCALHOST, getControlPort()); + sockControl.setKeepAlive(true); + sockControl.setSoTimeout(2000); + pwSocket = new PrintWriter(sockControl.getOutputStream()); + brSocket = new BufferedReader(new InputStreamReader(sockControl.getInputStream()), 1024); + } catch (IOException ex) { + Logger.getGlobal().throwing(TorController.class + .getName(), + "openControlSocket() on Port=" + getListenPort(), ex); + } + } + + private void closeControlSocket() { + try { + if (sockControl != null) { + sockControl.setKeepAlive(false); + sockControl.close(); + sockControl = null; + pwSocket.close(); + brSocket.close(); + pwSocket = null; + brSocket = null; + + } + } catch (IOException ex) { + Logger.getGlobal().throwing(TorController.class + .getName(), + "closeControlSocket() on Port=" + getListenPort(), ex); + } + } + + /** + * Send a command to tor client + * + * @param command + * @return Arraylist containing the result of the command + */ + public final synchronized ArrayList sendCommand(String command) { + + ArrayList result = new ArrayList<>(); + + if (sockControl == null) { + Logger.getGlobal().logp(Level.WARNING, TorController.class + .getName(), + "sendCommand() Port=" + getListenPort(), "Cmd=" + command + + ", Non-existent socket"); + return result; + } + + if (sockControl.isClosed()) { + Logger.getGlobal().logp(Level.WARNING, TorController.class + .getName(), + "sendCommand() Port=" + getListenPort(), "Cmd=" + command + + ", Socket is closed."); + return result; + } + + flushReadBuffer(); + + // Write out the command + if (pwSocket.checkError()) { + Logger.getGlobal().logp(Level.FINEST, TorController.class + .getName(), + "sendCommand() Port=" + getListenPort(), "Cmd=" + command + + ", Write Socket Error"); + return result; + } + + pwSocket.write(command + "\r\n"); + pwSocket.flush(); + + // Dont wait for command response if quitting + if (command.contentEquals("QUIT")) { + return result; + } + + result = getCommandResponse(); + + if (!result.isEmpty()) { + Logger.getGlobal().logp(Level.FINEST, TorController.class + .getName(), + "sendCommand() Port=" + getListenPort(), "Cmd=" + command + + ", Response=" + result.toString()); + } else { + Logger.getGlobal().logp(Level.WARNING, TorController.class + .getName(), + "sendCommand() Port=" + getListenPort(), "Cmd=" + command + + ", Response=Timed out"); + } + return result; + } + + private ArrayList getCommandResponse() { + + boolean boolMultiReply = false; + String response; + ArrayList result = new ArrayList<>(); + try { + while (true) { + response = brSocket.readLine(); + if (response == null) { + break; + } + // Check to see if we are in the middle of a multi line reply + if (boolMultiReply) { + // A multiline extended reply is part terminated by a fullstop + if (response.startsWith(".")) { + boolMultiReply = false; + } else { + result.add(response); + } + continue; + } + // Check for the start of a multi line reply + if (response.startsWith("250+")) { + boolMultiReply = true; + response = response.substring(response.indexOf('=') + 1).trim(); + if (!response.isEmpty()) { + result.add(response); + } + continue; + } + // Check for single line reply + if (response.startsWith("250-")) { + response = response.substring(response.indexOf('=') + 1).trim(); + if (!response.isEmpty()) { + result.add(response); + } + continue; + } + result.add(response); + if (response.startsWith("250 ") || response.startsWith("251 ") + || response.startsWith("4") || response.startsWith("5")) { + break; + } + } + } catch (IOException ex) { + result.clear(); + } + return result; + } + + private void flushReadBuffer() { + try { + while (brSocket.ready()) { + brSocket.readLine(); + } + } catch (IOException ex) { + } + } + + /** + * Create a socks4a socket to this URL on this tor connection, if nowww is + * true then remove www. from domain + * + * @param url + * @param nowww + * @return socket + */ + public Socket createTorSocketToURL(String url, boolean nowww) { + + try { + URI uri = new URI(url); + String host = uri.getHost().toLowerCase(); + if (nowww) { + host = host.replace("www.", ""); + } + String protocol = uri.getScheme(); + int port = uri.getPort(); + if (port == -1) { + switch (protocol) { + default: + port = 80; + break; + case "https": + port = 443; + break; + } + } + return createSocks4aSocket(LOCALHOST, getListenPort(), host, port); + + } catch (URISyntaxException ex) { + Logger.getLogger(TorController.class + .getName()).log(Level.SEVERE, null, ex); + } + return null; + } + + /** + * Create a Socks4a socket Taken from Wikipedia SOCKS4a is a simple + * extension to SOCKS4 protocol that allows a client that cannot resolve the + * destination host's domain name to specify it. + * + * The client should set the first three bytes of DSTIP to NULL and the last + * byte to a non-zero value. (This corresponds to IP address 0.0.0.x, with x + * nonzero, an inadmissible destination address and thus should never occur + * if the client can resolve the domain name.) Following the NULL byte + * terminating USERID, the client must send the destination domain name and + * terminate it with another NULL byte. This is used for both "connect" and + * "bind" requests. + * + * Client to SOCKS server: field 1: SOCKS version number, 1 byte, must be + * 0x04 for this version field 2: command code, 1 byte: 0x01 = establish a + * TCP/IP stream connection 0x02 = establish a TCP/IP port binding field 3: + * network byte order port number, 2 bytes field 4: deliberate invalid IP + * address, 4 bytes, first three must be 0x00 and the last one must not be + * 0x00 field 5: the user ID string, variable length, terminated with a null + * (0x00) field 6: the domain name of the host we want to contact, variable + * length, terminated with a null (0x00) + * + * + * Server to SOCKS client: field 1: null byte field 2: status, 1 byte: 0x5a + * = request granted 0x5b = request rejected or failed 0x5c = request failed + * because client is not running identd (or not reachable from the server) + * 0x5d = request failed because client's identd could not confirm the user + * ID string in the request field 3: network byte order port number, 2 bytes + * field 4: network byte order IP address, 4 bytes + * + * A server using protocol SOCKS4A must check the DSTIP in the request + * packet. If it represents address 0.0.0.x with nonzero x, the server must + * read in the domain name that the client sends in the packet. The server + * should resolve the domain name and make connection to the destination + * host if it can. + * + * @param socksaddr Socks ip address + * @param socksport Socks port + * @param remotehost Remote host + * @param remoteport Remote port + * @return Socket + */ + public Socket createSocks4aSocket(String socksaddr, int socksport, String remotehost, int remoteport) { + try { + Socket s = new Socket(socksaddr, socksport); + DataOutputStream dos = new DataOutputStream(s.getOutputStream()); + dos.writeByte(0x04); // Version 4 Socks + dos.writeByte(0x01); // Connect command code + dos.writeShort(remoteport); // Remote Port number + dos.writeInt(0x01); // IP address of 0.0.0.1 means use Socks 4a + dos.writeByte(0x00); // Null terminator + dos.writeBytes(remotehost); // Remote host IP address + dos.writeByte(0x00); // Null terminator + return s; + } catch (IOException ex) { + Logger.getGlobal().logp(Level.FINE, this.getClass().getName(), "createSocks4aSocket", "", ex); + } + return null; + } + +} diff --git a/src/client/TorMonFrame.form b/src/client/TorMonFrame.form new file mode 100644 index 0000000..a12e824 --- /dev/null +++ b/src/client/TorMonFrame.form @@ -0,0 +1,195 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/client/TorMonFrame.java b/src/client/TorMonFrame.java new file mode 100644 index 0000000..26ff8cb --- /dev/null +++ b/src/client/TorMonFrame.java @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import javax.swing.JTextArea; +import lib.GTKFixes; +import lib.Localisation; +import lib.OSFunction; + +/** + * + * @author Alistair Neil + */ +public class TorMonFrame extends javax.swing.JFrame { + + private static final Localisation LOCAL = new Localisation("resources/MessagesBundle"); + + /** + * Creates new form TorMonFrame + */ + public TorMonFrame() { + initComponents(); + jTextAreaLaunch.setOpaque(OSFunction.isWindows()); + jTextAreaStdOut.setOpaque(OSFunction.isWindows()); + GTKFixes.fixTextAreaColor(jTextAreaLaunch); + GTKFixes.fixTextAreaColor(jTextAreaStdOut); + } + + /** + * Set launch command text + * + * @param command + */ + public void setLaunchString(String command) { + jTextAreaLaunch.setText(command); + jTextAreaLaunch.setCaretPosition(0); + } + + public JTextArea getStdoutTextArea() { + return jTextAreaStdOut; + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jPanelMain = new javax.swing.JPanel(); + jPanel1 = new javax.swing.JPanel(); + jScrollPane1 = new javax.swing.JScrollPane(); + jTextAreaLaunch = new javax.swing.JTextArea(); + jPanel2 = new javax.swing.JPanel(); + jScrollPaneStdOut = new javax.swing.JScrollPane(); + jTextAreaStdOut = new javax.swing.JTextArea(); + jButtonClose = new javax.swing.JButton(); + + setMinimumSize(new java.awt.Dimension(554, 492)); + + jPanelMain.setFont(jPanelMain.getFont().deriveFont(jPanelMain.getFont().getStyle() | java.awt.Font.BOLD)); + + jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_startupargs"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelMain.getFont())); // NOI18N + + jTextAreaLaunch.setEditable(false); + jTextAreaLaunch.setColumns(38); + jTextAreaLaunch.setLineWrap(true); + jTextAreaLaunch.setRows(7); + jScrollPane1.setViewportView(jTextAreaLaunch); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + + jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, LOCAL.getString("panel_stdout"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, jPanelMain.getFont())); // NOI18N + + jTextAreaStdOut.setEditable(false); + jTextAreaStdOut.setColumns(38); + jTextAreaStdOut.setRows(8); + jScrollPaneStdOut.setViewportView(jTextAreaStdOut); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPaneStdOut) + .addContainerGap()) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPaneStdOut) + .addContainerGap()) + ); + + jButtonClose.setText(LOCAL.getString("button_close")); // NOI18N + jButtonClose.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonCloseActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanelMainLayout = new javax.swing.GroupLayout(jPanelMain); + jPanelMain.setLayout(jPanelMainLayout); + jPanelMainLayout.setHorizontalGroup( + jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelMainLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelMainLayout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jButtonClose))) + .addContainerGap()) + ); + jPanelMainLayout.setVerticalGroup( + jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelMainLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonClose) + .addContainerGap()) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanelMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanelMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + + pack(); + }// //GEN-END:initComponents + + private void jButtonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed + this.setVisible(false); + }//GEN-LAST:event_jButtonCloseActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButtonClose; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanelMain; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JScrollPane jScrollPaneStdOut; + private javax.swing.JTextArea jTextAreaLaunch; + private javax.swing.JTextArea jTextAreaStdOut; + // End of variables declaration//GEN-END:variables +} diff --git a/src/client/TorProcess.java b/src/client/TorProcess.java new file mode 100644 index 0000000..2cad96d --- /dev/null +++ b/src/client/TorProcess.java @@ -0,0 +1,845 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package client; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URI; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Pattern; +import javax.swing.JTextArea; +import javax.swing.text.BadLocationException; +import lib.ClientProcess; +import lib.SimpleFile; + +/** + * + * @author Alistair Neil + */ +public class TorProcess extends ClientProcess { + + public static final int LOG_DEBUG = 0; + public static final int LOG_INFO = 1; + public static final int LOG_NOTICE = 2; + private static final String TORCONFIGFILE = "torrc"; + public static final String EMPTYSTRING = ""; + + // Event constants + public static final int TOR_MESSAGE = 0; + public static final int TOR_BOOT_TIMEOUT = 1; + public static final int TOR_BOOT_FATAL = 2; + public static final int TOR_BOOT_ERROR = 3; + public static final int TOR_CLOCK_ERROR = 4; + public static final int TOR_NOROUTE = 5; + public static final int TOR_BOOTED = 6; + public static final int TOR_RESTARTED = 7; + public static final int TOR_NOEXITS = 8; + public static final int TOR_STOPPED = 9; + public static final int TOR_BRIDGE = 10; + public static final int TOR_NEWCIRC = 11; + public static final int TOR_DIRINFO_STALE = 12; + public static final int TOR_NOHOP0 = 13; + public static final int TOR_NONET_ACTIVITY = 14; + private static final String[] EVENTMESSAGES = new String[]{ + "TOR_MESSAGE", "TOR_BOOT_TIMEOUT", "TOR_BOOT_FATAL", "TOR_BOOT_ERROR", + "TOR_CLOCK_ERROR", "TOR_NOROUTE", "TOR_BOOTED", "TOR_RESTARTED", + "TOR_NOEXITS", "TOR_STOPPED", "TOR_BRIDGE", "TOR_NEWCIRC", + "TOR_DIRINFO_STALE", "TOR_NOHOP0", "TOR_NONET_ACTIVITY" + }; + + private final LinkedHashMap lhmCLIOptions; + private final LinkedHashMap lhmTorrcOptions; + private final String strClientLocation; + private final String strConfigFolder; + private String strSecret; + private String strCachedDataFolder; + private String invCommas = "\""; + private String strExternalArgs = ""; + private String strBridges = ""; + private int intListenPort; + private int intInitialBootEvent; + private int loglev = LOG_NOTICE; + private float version = 9999; + private int maxlines = 50; + private int nolines; + private JTextArea jtxtstdout; + private boolean boolSilentBoot; + + /** + * Constructor + * + * @param clientpath Path to Tor client + * @param configfolder Filepath to torrc + */ + public TorProcess(String clientpath, String configfolder) { + setSilentBootEnabled(false); + strClientLocation = clientpath; + this.intInitialBootEvent = TOR_BOOTED; + this.strConfigFolder = configfolder; + this.lhmCLIOptions = new LinkedHashMap<>(); + this.lhmTorrcOptions = new LinkedHashMap<>(); + // All our initialisation + if (SimpleFile.getSeparator().compareTo("/") == 0) { + this.invCommas = ""; + } + } + + /** + * Starts Tor process, and issues booted event on completion + * + */ + public final void startProcess() { + setStartupTimeout(60); + // Cache age check + float age = getCacheAge(); + Logger.getGlobal().logp(Level.INFO, TorProcess.class.getName(), + "start() on Port=" + getListenPort(), "Cache age = " + (int) age + " minutes."); + if (age > 180) { + deleteCacheData(); + Logger.getGlobal().logp(Level.INFO, TorProcess.class.getName(), + "start() on Port=" + getListenPort(), "Cache stale, deleting old cache data."); + } + // Some essential initialisation + String strConfig = strClientLocation + + " -f " + invCommas + + getConfigFilePath() + + invCommas + + " " + getCLIOptionsAsString() + + " " + strExternalArgs; + Logger.getGlobal().logp(Level.INFO, TorProcess.class.getName(), + "start() on Port=" + getListenPort(), + "INFO: starting with " + strConfig ); + super.start(strConfig); + } + + /** + * Set the Tor stdout log level + * + * @param lev + */ + public final void setLogLevel(int lev) { + loglev = lev; + } + + /** + * Set external user provided startup arguments + * + * @param torargs + */ + public final void setExternalArgs(String torargs) { + strExternalArgs = torargs; + } + + /** + * Set the listening port + * + * @param port + */ + public final void setListenPort(int port) { + // Setup listening port and control port + if (intListenPort == port) { + return; + } + intListenPort = port; + setCLIOption("SocksPort", "127.0.0.1:" + String.valueOf(port)); + setCLIOption("ControlSocket", "/run/tor/control"); + setCLIOption("ControlPort", "127.0.0.1:" + String.valueOf(port + 1)); + // Finish of by creating the default config file and data folders + createDataFolder(); + } + + /** + * Set the event that is issued on process boot completion + * + * @param event + */ + public final void setInitialBootEvent(int event) { + intInitialBootEvent = event; + } + + /** + * Client event handler, can be overriden by parent class + * + * @param data line data from standard output of Tor client + */ + @Override + public final void clientProcessEventFired(String data) { + + Logger.getGlobal().logp(Level.FINER, TorProcess.class.getName(), + "clientProcessEventFired() on Port=" + getListenPort(), data); + + if (!data.isEmpty()) { + appendStdout(data); + } + + // Check for process stopped + if (getClientStatus() == CLIENT_STOPPED) { + torProcessEventFired(TOR_STOPPED, null); + return; + } + + // Check for timeout + if (getClientStatus() == CLIENT_TIMEDOUT) { + torProcessEventFired(TOR_BOOT_TIMEOUT, null); + return; + } + + if (getClientStatus() == CLIENT_RUNNING) { + // Check to see if we need to copy cache + if (strCachedDataFolder != null) { + SimpleFile.copyFolderContents(strCachedDataFolder, getDataFolder() + SimpleFile.getSeparator(), "torrc"); + strCachedDataFolder = null; + } + // Check for fatal tor process startup errors + if (data.contains("[warn] Our clock")) { + torProcessEventFired(TOR_CLOCK_ERROR, data); + return; + } + // Check for errors + if (data.contains("exception") || data.contains("[err]")) { + torProcessEventFired(TOR_BOOT_FATAL, data); + return; + } + // Check for network unreachable + if (data.contains("NOROUTE")) { + torProcessEventFired(TOR_NOROUTE, data); + return; + } + // Check new tor bridge + if (data.contains("[notice] new bridge")) { + torProcessEventFired(TOR_BRIDGE, data); + return; + } + // Check for conditions that may prevent circuit building + if (data.contains("directory information is no longer up-to-date")) { + torProcessEventFired(TOR_DIRINFO_STALE, data); + return; + } + // Check for conditions that will prevent circuit building + if (data.contains("All routers are down")) { + torProcessEventFired(TOR_NOEXITS, data); + return; + } + // Check for Tor retrying on new circuit + if (data.contains("Retrying on a new circuit")) { + torProcessEventFired(TOR_NEWCIRC, data); + return; + } + // Check for Tor failed to find hop zero + if (data.contains("Failed to find node for hop 0")) { + torProcessEventFired(TOR_NOHOP0, data); + return; + } + // Check for no net activity + if (data.contains("Tor has not observed any network activity")) { + torProcessEventFired(TOR_NONET_ACTIVITY, data); + return; + } + // Check for a bootstrap message + if (data.contains("Bootstrapped")) { + // If silent then dont fire bootstrapping messages + if (!boolSilentBoot) { + torProcessEventFired(TOR_MESSAGE, data.substring(data.indexOf(']') + 2)); + } + int percent = getPercentage(data); + // Set startup timeout based on percentage of Tor progression + if (percent >= 15) { + setStartupTimeout(60); + } + if (percent >= 40) { + setStartupTimeout(120); + } + if (percent >= 80) { + setStartupTimeout(30); + } + // Check for initial bootup completion + if (percent >= 100) { + setStartupTimeout(-1); + torProcessEventFired(intInitialBootEvent, null); + intInitialBootEvent = TOR_BOOTED; + setSilentBootEnabled(false); + } + } + } + } + + /** + * Get percentage value from bootstrap message + * + * @param data + * @return percentage as and int + */ + private int getPercentage(String data) { + int result = -1; + int idx1 = data.indexOf("Bootstrapped "); + if (idx1 > -1) { + idx1 += 13; + int idx2 = data.indexOf('%', idx1); + if (idx2 > -1) { + String temp = data.substring(idx1, idx2); + result = Integer.parseInt(temp); + } + } + return result; + } + + /** + * Enable/Disable bootstrap message events on startup + * + * @param enabled + */ + public final void setSilentBootEnabled(boolean enabled) { + boolSilentBoot = enabled; + } + + /** + * Get textual representation on an event + * + * @param event + * @return Event as text + */ + public String getEventMessage(int event) { + return EVENTMESSAGES[event]; + } + + /** + * Called if an event was fired, will be overidden by sub class + * + * @param event + * @param data + */ + public void torProcessEventFired(int event, String data) { + } + + public final void setControlPassword(String secret, String hashpass) { + strSecret = secret; + setCLIOption("hashedcontrolpassword", hashpass); + } + + /** + * Get the currently set authentification secret + * + * @return String + */ + public final String getSecret() { + return strSecret; + } + + /** + * Set Tor bridges, supports multiple addresses + * + * @param bridges + */ + public final void setBridges(String bridges) { + + clearCLIOption("UseBridges"); + clearCLIOption("Bridge"); + clearCLIOption("UpdateBridgesFromAuthority"); + strBridges = ""; + if (bridges == null || bridges.isEmpty()) { + return; + } + StringBuilder sbBridgesOption = new StringBuilder(); + String sep = ""; + String[] arrBridges = Pattern.compile(",").split(bridges); + for (String s : arrBridges) { + sbBridgesOption.append(sep); + sbBridgesOption.append(s); + if (sep.isEmpty()) { + sep = " --Bridge "; + } + } + strBridges = bridges; + setCLIOption("UseBridges", "1"); + setCLIOption("UpdateBridgesFromAuthority", "1"); + setCLIOption("Bridge", sbBridgesOption.toString()); + } + + /** + * Validate bridge addresses + * + * @param bridges + * @return true if valid + */ + public boolean validateBridges(String bridges) { + if (bridges.isEmpty()) { + return true; + } + String[] arrBridges = Pattern.compile(",").split(bridges); + for (String s : arrBridges) { + if (!validateHostPort(s)) { + return false; + } + } + return true; + } + + /** + * Validate a host:port ipv4 address + * + * @param hostport + * @return true if valid + */ + public final boolean validateHostPort(String hostport) { + + try { + URI uri = new URI("my://" + hostport); // may throw URISyntaxException + if (uri.getHost() == null || uri.getPort() == -1) { + return false; + } + } catch (Exception ex) { + return false; + } + return true; + } + + /** + * Get bridges + * + * @return bridges as csv string + */ + public final String getBridges() { + return strBridges; + } + + /** + * Set Ownership process id, useful for proper process termination in event + * of a crash + * + * @param processid + */ + public void setOwnershipID(String processid) { + this.setCLIOption("__OwningControllerProcess", processid); + } + + /** + * Return the currently set process ownership ID + * + * @return String process id + */ + public String getOwnershipID() { + return getCLIOptions("__OwningControllerProcess"); + } + + /** + * Set the path to the geoip file + * + * @param filepath File location + */ + public final void setGeoIP4(String filepath) { + if (filepath != null) { + if (SimpleFile.exists(filepath)) { + setTorrcOption("GeoIPFile", invCommas + filepath + invCommas); + } else { + clearTorrcOption("GeoIPFile"); + } + } else { + clearTorrcOption("GeoIPFile"); + } + } + + /** + * Set the path to the geoip file + * + * @param filepath File location + */ + public final void setGeoIP6(String filepath) { + if (filepath != null) { + if (SimpleFile.exists(filepath)) { + setTorrcOption("GeoIPv6File", invCommas + filepath + invCommas); + } else { + clearTorrcOption("GeoIPv6File"); + } + } else { + clearTorrcOption("GeoIPv6File"); + } + } + + /** + * Get Tor client location as a filepath + * + * @return filepath as string + */ + public final String getClientLocation() { + return strClientLocation; + } + + /** + * Get the path to the configuration file + * + * @return String Path to configuration file + */ + public final String getConfigFilePath() { + return getDataFolder() + File.separator + TORCONFIGFILE; + } + + /** + * Get a previously added tor option string + * + * @param option Tor option key + * @return String Tor option value + */ + public final String getCLIOptions(String option) { + return lhmCLIOptions.get(option); + } + + /** + * Add a tor option string which is passed to the tor client on startup. See + * Tor documentation for valid options. + * + * @param option + * @param value + */ + public final void setCLIOption(String option, String value) { + lhmCLIOptions.put(option, value); + } + + /** + * Add a tor option boolean value + * + * @param option + * @param value + */ + public final void setBoolTorOption(String option, boolean value) { + lhmCLIOptions.remove(option); + if (value) { + lhmCLIOptions.put(option, "1"); + } else { + lhmCLIOptions.put(option, "0"); + } + } + + /** + * Get a previously added tor option string + * + * @param option Tor option key + * @return String Tor option value + */ + public final String getTorrcOption(String option) { + return lhmTorrcOptions.get(option); + } + + /** + * Add a torrc option string See Tor documentation for valid options. + * + * @param option + * @param value + */ + public final void setTorrcOption(String option, String value) { + if (value.startsWith("\"")) { + value = value.replace('\\', '/'); + } + lhmTorrcOptions.put(option, value); + } + + /** + * Gets all the currently set torrc options as single String + * + * @return String Tor client formatted cli arguments + */ + public final String getTorrcOptionsAsString() { + Iterator iterator = lhmTorrcOptions.keySet().iterator(); + String key; + StringBuilder sbResult = new StringBuilder(); + while (iterator.hasNext()) { + key = iterator.next(); + sbResult.append(key); + sbResult.append(" "); + sbResult.append(lhmTorrcOptions.get(key)); + sbResult.append("\r\n"); + } + return sbResult.toString(); + } + + /** + * Remove previously add torrc option + * + * @param option + */ + public final void clearTorrcOption(String option) { + lhmTorrcOptions.remove(option); + } + + /** + * Get a previously added tor option boolean value + * + * @param option Tor option key + * @return Boolean value + */ + public final boolean getCLIOptionBool(String option) { + return lhmCLIOptions.get(option).contentEquals("1"); + } + + /** + * Remove previously add tor option + * + * @param option + */ + public final void clearCLIOption(String option) { + lhmCLIOptions.remove(option); + } + + /** + * Gets all the currently set tor options as single String for use as + * arguments passed to tor client + * + * @return String Tor cleint formatted cli arguments + */ + public final String getCLIOptionsAsString() { + Iterator iterator = lhmCLIOptions.keySet().iterator(); + String key; + String value; + StringBuilder sbResult = new StringBuilder(); + while (iterator.hasNext()) { + key = iterator.next(); + sbResult.append("--"); + sbResult.append(key); + sbResult.append(" "); + value = lhmCLIOptions.get(key); + if (!value.isEmpty()) { + sbResult.append(value); + sbResult.append(" "); + } + } + return sbResult.toString().trim(); + } + + /** + * Get the listening port + * + * @return port + */ + public final int getListenPort() { + return intListenPort; + } + + /** + * Get the control port + * + * @return port + */ + public final int getControlPort() { + return intListenPort + 1; + } + + /** + * Creates the default Tor config file + */ + public final void createDefaultConfig() { + SimpleFile sfTorrc = new SimpleFile(getConfigFilePath()); + sfTorrc.openBufferedWrite(); + sfTorrc.writeFile(getTorrcOptionsAsString(), 0); + switch (loglev) { + case LOG_DEBUG: + sfTorrc.writeFile("log debug stdout", 1); + break; + case LOG_INFO: + sfTorrc.writeFile("log info stdout", 1); + break; + case LOG_NOTICE: + sfTorrc.writeFile("log notice stdout", 1); + break; + } + + sfTorrc.writeFile(EMPTYSTRING, 1); + sfTorrc.closeFile(); + } + + /** + * Delete the configuration file + */ + public final void deleteConfigFile() { + SimpleFile.delete(getConfigFilePath()); + } + + /** + * Creates a data folder for the Tor client to put its cache data + */ + public final void createDataFolder() { + String folder = getDataFolder(); + if (folder != null) { + setTorrcOption("DataDirectory", invCommas + getDataFolder() + invCommas); + SimpleFile.createFolder(getDataFolder()); + } + } + + /** + * Get the datafolder being used by tor client + * + * @return Path to datafolder + */ + public final String getDataFolder() { + if (strConfigFolder == null) { + return null; + } + return strConfigFolder + String.valueOf(intListenPort); + } + + /** + * Get the age of the file cache in minutes + * + * @return age of cache in minutes + */ + public float getCacheAge() { + + String path = getDataFolder() + SimpleFile.getSeparator() + + "cached-consensus"; + if (SimpleFile.exists(path)) { + return SimpleFile.getAgeOfFile(path, SimpleFile.PERIOD_MINUTES); + } else { + return -1; + } + } + + /** + * Delete Tor cache data + */ + public final void deleteCacheData() { + SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "cached-consensus"); + SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "cached-certs"); + SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "cached-descriptors"); + SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "cached-descriptors.new"); + SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "lock"); + SimpleFile.secureWipe(getDataFolder() + SimpleFile.getSeparator() + "state"); + } + + /** + * This populates the the current folder whose name is derived from the + * listening port with data from the given source folder derived by the + * given port number. This effectively allows each Tor client spawned to + * have its Tor cache data copied from the first Tor client launched instead + * of having to go to the net and fetch it and thus start up is a lot + * faster. I was actually mildly suprised that this actually works. + * + * @param port + */ + public final void setCachedDataFolder(int port) { + if (port < 0) { + strCachedDataFolder = null; + return; + } + strCachedDataFolder = strConfigFolder + String.valueOf(port); + } + + /** + * Get the currently set cached data folder + * + * @return path to cached data folder as String + */ + public final String getCachedDataFolder() { + return strCachedDataFolder; + } + + /** + * Set the text area that will receive Stdout output + * + * @param jta + */ + public void setStdoutTextArea(JTextArea jta) { + jtxtstdout = jta; + } + + /** + * Set the maximum no of lines to display in the Stdout output + * + * @param lines + */ + public void setMaxHistory(int lines) { + maxlines = lines; + } + + /** + * Clear the Stdout text area + */ + public void clearStdout() { + if (jtxtstdout != null) { + jtxtstdout.setText(""); + } + nolines = 0; + } + + /** + * Append text to the StdOut text area + * + * @param text + */ + private void appendStdout(String text) { + if (jtxtstdout == null) { + return; + } + jtxtstdout.append(text + "\n"); + if (++nolines > maxlines) { + try { + int end = jtxtstdout.getLineEndOffset(0); + jtxtstdout.replaceRange("", 0, end); + } catch (BadLocationException ex) { + } + } + jtxtstdout.setCaretPosition(jtxtstdout.getText().length()); + } + + /** + * Get Tor version as float + * + * @return Tor version as String + */ + public final float getVersion() { + if (version == 9999) { + BufferedReader br; + String strVer = ""; + Process proc; + try { + proc = Runtime.getRuntime().exec(strClientLocation + " --version"); + br = new BufferedReader(new InputStreamReader(proc.getInputStream()), 256); + String line; + while (true) { + line = br.readLine(); + if (line == null) { + break; + } + strVer = line; + } + br.close(); + proc.destroy(); + proc.waitFor(); + } catch (IOException | InterruptedException ex) { + Logger.getLogger(TorProcess.class.getName()).log(Level.SEVERE, null, ex); + } + int idx = strVer.indexOf("ion"); + if (idx > -1) { + strVer = strVer.substring(idx + 4).replace(".", ""); + idx = strVer.indexOf(' '); + if (idx > -1) { + strVer = strVer.substring(0, idx); + } + try { + version = Float.parseFloat("0." + strVer) * 10; + } catch (Exception ex) { + Logger.getGlobal().logp(Level.SEVERE, this.getClass().getName(), "getVersion() Port=" + intListenPort, "", ex); + } + } + } + return version; + } + +} diff --git a/src/lib/AboutDialog.form b/src/lib/AboutDialog.form new file mode 100644 index 0000000..562a0ba --- /dev/null +++ b/src/lib/AboutDialog.form @@ -0,0 +1,135 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/lib/AboutDialog.java b/src/lib/AboutDialog.java new file mode 100644 index 0000000..b000046 --- /dev/null +++ b/src/lib/AboutDialog.java @@ -0,0 +1,233 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.awt.Image; +import javax.swing.ImageIcon; + +/** + * + * @author Alistair Neil, + */ +public class AboutDialog extends javax.swing.JDialog { + + private String strHome = null; + private String strContact = null; + + /** + * Creates new About Dialog + * + * @param parent + * @param modal + */ + public AboutDialog(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + } + + /** + * Set appliction description + * + * @param text + */ + public void setAppDescription(String text) { + jTextAreaVersion.setText(text); + } + + /** + * Set application logo + * + * @param ii + */ + public void setAppLogo(ImageIcon ii) { + Image im = ii.getImage().getScaledInstance(jLabelAppLogo.getWidth(), jLabelAppLogo.getHeight(), Image.SCALE_SMOOTH); + ii.setImage(im); + jLabelAppLogo.setIcon(ii); + } + + /** + * Set home url + * + * @param home + */ + public void setHomeURL(String home) { + strHome = home; + } + + /** + * Set contact url + * + * @param contact + */ + public void setContactURL(String contact) { + strContact = contact; + } + + /** + * Set text on Contact button + * + * @param text + */ + public void setButtonContactText(String text) { + jButtonContact.setText(text); + } + + /** + * Set text on Visit button + * + * @param text + */ + public void setButtonVisitText(String text) { + jButtonVisit.setText(text); + } + + /** + * Set text on Close button + * + * @param text + */ + public void setButtonCloseText(String text) { + jButtonClose.setText(text); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jPanel1 = new javax.swing.JPanel(); + jButtonVisit = new javax.swing.JButton(); + jButtonContact = new javax.swing.JButton(); + jButtonClose = new javax.swing.JButton(); + jLabelAppLogo = new javax.swing.JLabel(); + jTextAreaVersion = new javax.swing.JTextArea(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Title"); + setResizable(false); + + jButtonVisit.setText("Visit Us"); + jButtonVisit.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonVisitActionPerformed(evt); + } + }); + + jButtonContact.setText("Contact Us"); + jButtonContact.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonContactActionPerformed(evt); + } + }); + + jButtonClose.setText("Close"); + jButtonClose.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonCloseActionPerformed(evt); + } + }); + + jLabelAppLogo.setVerticalAlignment(javax.swing.SwingConstants.TOP); + jLabelAppLogo.setPreferredSize(new java.awt.Dimension(128, 128)); + + jTextAreaVersion.setEditable(false); + jTextAreaVersion.setColumns(15); + jTextAreaVersion.setForeground(jPanel1.getForeground()); + jTextAreaVersion.setLineWrap(true); + jTextAreaVersion.setRows(5); + jTextAreaVersion.setWrapStyleWord(true); + jTextAreaVersion.setBorder(null); + jTextAreaVersion.setFocusable(false); + jTextAreaVersion.setOpaque(false); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jButtonVisit) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonContact) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonClose)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabelAppLogo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jTextAreaVersion, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(jLabelAppLogo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jTextAreaVersion)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(jButtonVisit) + .addComponent(jButtonContact) + .addComponent(jButtonClose))) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + + private void jButtonVisitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVisitActionPerformed + if (strHome != null) { + Utilities.openFileExternally(strHome); + } + }//GEN-LAST:event_jButtonVisitActionPerformed + + private void jButtonContactActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonContactActionPerformed + if (strContact != null) { + Utilities.openFileExternally(strContact); + } + }//GEN-LAST:event_jButtonContactActionPerformed + + private void jButtonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed + dispose(); + }//GEN-LAST:event_jButtonCloseActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButtonClose; + private javax.swing.JButton jButtonContact; + private javax.swing.JButton jButtonVisit; + private javax.swing.JLabel jLabelAppLogo; + private javax.swing.JPanel jPanel1; + private javax.swing.JTextArea jTextAreaVersion; + // End of variables declaration//GEN-END:variables +} diff --git a/src/lib/ClientProcess.java b/src/lib/ClientProcess.java new file mode 100644 index 0000000..4992063 --- /dev/null +++ b/src/lib/ClientProcess.java @@ -0,0 +1,233 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.SwingWorker; + +/** + * + * @author Alistair Neil + */ +public class ClientProcess { + + public static final int CLIENT_STOPPED = 0; + public static final int CLIENT_RUNNING = 1; + public static final int CLIENT_TIMEDOUT = 2; + private long initialdelay = 0; + private volatile long startupTimeout; + private SwingWorker, String> swWorker; + private volatile Process procApplication; + private PrintWriter pwWriter; + private volatile Thread threadSleep; + private int intStatus = CLIENT_STOPPED; + + /** + * Constructor + */ + public ClientProcess() { + setStartupTimeout(15); + } + + /** + * Set the initial delay that is executed prior to starting the process + * + * @param ms + */ + public final void setStartupDelay(long ms) { + initialdelay = ms; + } + + /** + * Set startup timeout + * + * @param seconds + */ + public final void setStartupTimeout(long seconds) { + startupTimeout = seconds * 1000; + } + + /** + * Starts the client process + * + * @param processpath + */ + public final void start(final String processpath) { + swWorker = new SwingWorker, String>() { + + String line; + int endstatus; + + @Override + protected ArrayList doInBackground() { + BufferedReader brProcInput = null; + BufferedReader brProcError = null; + try { + endstatus = CLIENT_STOPPED; + if (isCancelled()) { + return null; + } + threadSleep = Thread.currentThread(); + if (initialdelay > 0) { + try { + Thread.sleep(initialdelay); + } catch (InterruptedException ex) { + } + } + threadSleep = null; + initialdelay = 0; + if (isCancelled()) { + return null; + } + procApplication = Runtime.getRuntime().exec(processpath); + if (procApplication == null) { + return null; + } + brProcInput = new BufferedReader(new InputStreamReader(procApplication.getInputStream()), 512); + brProcError = new BufferedReader(new InputStreamReader(procApplication.getErrorStream()), 512); + pwWriter = new PrintWriter(procApplication.getOutputStream()); + long timeout = System.currentTimeMillis() + startupTimeout; + while (!isCancelled()) { + if (brProcInput.ready()) { + timeout = System.currentTimeMillis() + startupTimeout; + // Read process notifications + line = brProcInput.readLine(); + publish(line); + } + if (brProcError.ready()) { + timeout = System.currentTimeMillis() + startupTimeout; + // Read process notifications + line = brProcError.readLine(); + publish(line); + } + if (System.currentTimeMillis() > timeout && startupTimeout > 0) { + endstatus = CLIENT_TIMEDOUT; + break; + } + threadSleep = Thread.currentThread(); + try { + Thread.sleep(20); + } catch (InterruptedException ex) { + } + threadSleep = null; + } + } catch (Exception ex) { + Logger.getGlobal().logp(Level.INFO, ClientProcess.class.getName(), + "SwingWorker Loop Exception", ex.getMessage()); + } finally { + // Cleanup resources + try { + if (brProcInput != null) { + brProcInput.close(); + } + if (brProcError != null) { + brProcError.close(); + } + pwWriter.close(); + // Destroy process + if (procApplication != null) { + procApplication.getOutputStream().close(); + procApplication.getInputStream().close(); + procApplication.getErrorStream().close(); + procApplication.destroy(); + } + } catch (Exception ex) { + Logger.getGlobal().logp(Level.INFO, ClientProcess.class.getName(), + "SwingWorker Cleanup", ex.getMessage()); + } + } + return null; + } + + @Override + protected void process(List chunks) { + for (String s : chunks) { + if (s != null) { + clientProcessEventFired(s); + } + } + } + + @Override + protected void done() { + intStatus = endstatus; + clientProcessEventFired(""); + } + + }; + intStatus = CLIENT_RUNNING; + clientProcessEventFired(""); + // Start client process + swWorker.execute(); + } + + public final int getClientStatus() { + return intStatus; + } + + /** + * Return the client system process + * + * @return a process + */ + public final Process getProcess() { + return procApplication; + } + + /** + * Stops the client process + * + */ + public final void stopProcess() { + if (threadSleep != null) { + threadSleep.interrupt(); + } + if (swWorker != null) { + swWorker.cancel(true); + } + try { + procApplication.waitFor(); + } catch (Exception ex) { + Logger.getGlobal().logp(Level.INFO, ClientProcess.class.getName(), + "stopProcess", ex.getMessage()); + } + } + + /** + * Send a message to the process + * + * @param message + */ + public final void sendMessage(String message) { + pwWriter.write(message); + } + + /** + * Event from the process, should be overriden by sub class + * + * @param data + */ + public void clientProcessEventFired(String data) { + } +} diff --git a/src/lib/DesktopNotify.java b/src/lib/DesktopNotify.java new file mode 100644 index 0000000..a62416a --- /dev/null +++ b/src/lib/DesktopNotify.java @@ -0,0 +1,120 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * This class handles desktop notifications + * + * @author Alistair Neil + */ +public class DesktopNotify { + + private final String iconpath; + private String notifytitle; + private String notifybody; + private String notifysendpath; + private final SwingTrayIcon sti; + private boolean enabled; + private boolean supported = true; + + public DesktopNotify(SwingTrayIcon sti, String iconpath) { + this.sti = sti; + this.iconpath = iconpath; + if (OSFunction.isLinux()) { + this.notifysendpath = OSFunction.findFile("notify-send", "/usr/bin/"); + if (this.notifysendpath == null) { + Logger.getGlobal().log(Level.WARNING, "notify-send not found."); + this.supported = false; + } + } + } + + /** + * Is notifications supported + * + * @return true if supported + */ + public boolean isSupported() { + return supported; + } + + /** + * Are notifications enabled + * + * @return true if enabled + */ + public boolean isEnabled() { + return enabled; + } + + /** + * Disable/Enable notifications + * + * @param enabled + */ + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + /** + * Set desktop notification title + * + * @param text + */ + public void setNotificationTitle(String text) { + notifytitle = text; + } + + /** + * Set desktop notification body + * + * @param text + */ + public void setNotificationBody(String text) { + notifybody = text; + } + + /** + * Raise a notification + * + */ + public void raiseNotification() { + if (notifybody == null || notifytitle == null || !enabled) { + return; + } + if (OSFunction.isWindows()) { + if (sti != null) { + sti.displayMessage(notifytitle, notifybody); + } + } else { + if (notifysendpath != null) { + OSFunction.launchProcess("notify-send", "-u", "normal", + "-i", iconpath, notifytitle, notifybody); + } + } + notifybody = null; + } + + public String getNotifySendPath() { + return notifysendpath; + } + +} diff --git a/src/lib/ExtensionFileFilter.java b/src/lib/ExtensionFileFilter.java new file mode 100644 index 0000000..2067159 --- /dev/null +++ b/src/lib/ExtensionFileFilter.java @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil +* + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.io.File; +import javax.swing.filechooser.FileFilter; + +/** + * + * @author Alistair Neil, + * Taken from Oracle documentation. + */ +public class ExtensionFileFilter extends FileFilter { + + String description; + String extensions[]; + + /** + * Convenience constructor for a single extension + * + * @param description + * @param extension + */ + public ExtensionFileFilter(String description, String extension) { + this(description, new String[]{extension}); + } + + /** + * Convenience constructor for a multiple extensions + * + * @param description + * @param extensions + */ + public ExtensionFileFilter(String description, String extensions[]) { + if (description == null) { + this.description = extensions[0]; + } else { + this.description = description; + } + this.extensions = extensions.clone(); + toLower(this.extensions); + } + + private void toLower(String array[]) { + for (int i = 0, n = array.length; i < n; i++) { + array[i] = array[i].toLowerCase(); + } + } + + /** + * Get description + * + * @return String + */ + @Override + public String getDescription() { + return description; + } + + @Override + public boolean accept(File file) { + if (file.isDirectory()) { + return true; + } else { + String path = file.getAbsolutePath().toLowerCase(); + for (int i = 0, n = extensions.length; i < n; i++) { + String extension = extensions[i]; + if ((path.endsWith(extension) && (path.charAt(path.length() - extension.length() - 1)) == '.')) { + return true; + } + } + } + return false; + } +} diff --git a/src/lib/GTKFixes.java b/src/lib/GTKFixes.java new file mode 100644 index 0000000..e4e2cc6 --- /dev/null +++ b/src/lib/GTKFixes.java @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.awt.Color; +import java.awt.Dimension; +import javax.swing.BorderFactory; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JTextArea; +import javax.swing.UIManager; +import javax.swing.event.MenuEvent; + +/** + * + * @author Alistair Neil + */ +public class GTKFixes { + + public static void fixMenubarHeight(JMenuBar jmb, JMenuItem jmi) { + jmb.setPreferredSize(new Dimension(jmb.getPreferredSize().width, jmi.getPreferredSize().height)); + } + + /** + * Fixes incorrect JMenu selectionForeground and selectionBackground + * highlighting + * + * @param jms Array of JMenus or single JMenu + */ + public static void fixMenuSelectionColor(JMenu... jms) { + // If gtk laf not installed then do nothing + if (!UIManager.getLookAndFeel().getID().contentEquals("GTK")) { + return; + } + + for (final JMenu jm : jms) { + final Color bgfixed = new Color(((Color) UIManager.get("Menu.selectionBackground")).getRGB()); + final Color fgfixed = new Color(((Color) UIManager.get("Menu.selectionForeground")).getRGB()); + final Color fgnormal = jm.getForeground(); + final Color bgnormal = new Color(((Color) UIManager.get("Menu.background")).getRGB()); + jm.setText(" " + jm.getText() + " "); + jm.addMenuListener(new javax.swing.event.MenuListener() { + + @Override + public void menuSelected(MenuEvent e) { + jm.setOpaque(true); + jm.setForeground(fgfixed); + jm.setBackground(bgfixed); + } + + @Override + public void menuDeselected(MenuEvent e) { + jm.setOpaque(false); + jm.setForeground(fgnormal); + jm.setBackground(bgnormal); + } + + @Override + public void menuCanceled(MenuEvent e) { + jm.setOpaque(false); + jm.setForeground(fgnormal); + jm.setBackground(bgnormal); + } + }); + } + } + + /** + * Fixes incorrect JMenu border outline + * + * @param jms Array of JMenus or single JMenu + */ + public static void fixJMenuPopupBorder(JMenu... jms) { + // If gtk laf not installed then do nothing + if (!UIManager.getLookAndFeel().getID().contentEquals("GTK")) { + return; + } + for (final JMenu jm : jms) { + jm.getPopupMenu().setBorder(BorderFactory.createLineBorder( + new Color(UIManager.getColor("PopupMenu.background").getRGB()).darker(), 1)); + } + } + + public static void fixTrayMenuPopupBorder(TrayPopupMenu tpm) { + tpm.setBorder(BorderFactory.createLineBorder( + new Color(UIManager.getColor("PopupMenu.background").getRGB()).darker(), 1)); + } + + /** + * Fixes incorrect JMenu selectionForeground highlighting + * + * @param jmi Array of JMenuItems or single JMenuItem + */ + public static void fixMenuItemFgColor(JMenuItem... jmi) { + // If gtk laf not installed then do nothing + if (!UIManager.getLookAndFeel().getID().contentEquals("GTK")) { + return; + } + for (final JMenuItem jm : jmi) { + final Color fgfixed = new Color(UIManager.getColor("MenuItem.foreground").getRGB()); + jm.setForeground(fgfixed); + } + } + + public static void fixTextAreaColor(JTextArea jta) { + if (OSFunction.isLinux()) { + jta.setForeground(UIManager.getColor("JLabel.foreground")); + jta.setBackground(UIManager.getColor("JLabel.background")); + } + } + +} diff --git a/src/lib/InfoDialog.form b/src/lib/InfoDialog.form new file mode 100644 index 0000000..bf483b9 --- /dev/null +++ b/src/lib/InfoDialog.form @@ -0,0 +1,139 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/lib/InfoDialog.java b/src/lib/InfoDialog.java new file mode 100644 index 0000000..d8b4e54 --- /dev/null +++ b/src/lib/InfoDialog.java @@ -0,0 +1,549 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.awt.Color; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import javax.swing.JProgressBar; +import javax.swing.JTextArea; +import javax.swing.Timer; +import javax.swing.WindowConstants; + +/** + * + * @author Alistair Neil, + */ +public class InfoDialog extends javax.swing.JDialog { + + public static final int CANCEL_BUTTON = 0; + public static final int CANCEL_WINDOW = 1; + public static final int OK = 2; + private Color fg = null; + private final Frame parent; + private String strButtClose; + private String strTitle = ""; + private final Font fontDefault; + private Timer tmrAutoClose; + private Timer tmrButtonLock; + + /** + * Creates new InfoDialog, for parent frame with modality modal + * + * @param parent + */ + public InfoDialog(Frame parent) { + super(parent, true); + this.parent = parent; + initComponents(); + jCheckBoxOption.setVisible(false); + jProgressBar.setVisible(false); + fg = jTextInfo.getForeground(); + fontDefault = jTextInfo.getFont(); + setContinueButtonText("Continue"); + setCancelButtonText("Cancel"); + setCloseButtonText("Close"); + } + + @Override + public final Font getFont() { + return jPanelMain.getFont(); + } + + /** + * Convenience methods + * + * @param title + */ + public final void createInfo(String title) { + createInfo(title, null); + } + + /** + * + * @param title + * @param info + */ + public final void createInfo(String title, String info) { + super.setTitle(strTitle + " " + title); + setModal(true); + setCancelVisible(false); + setContinueButtonText(strButtClose); + jProgressBar.setVisible(false); + FontMetrics fm = getFontMetrics(getFont()); + int width = fm.stringWidth(getTitle()); + if (width > getWidth()) { + setSize(width, getHeight()); + } + jTextInfo.setFont(fontDefault); + jTextInfo.setForeground(fg); + jTextInfo.setText(""); + if (info != null) { + jTextInfo.setText(info); + } + jTextInfo.setCaretPosition(0); + setLocationRelativeTo(parent); + } + + /** + * Set dialog title + * + * @param title + */ + @Override + public final void setTitle(String title) { + strTitle = title; + super.setTitle(strTitle); + } + + /** + * + * @param title + */ + public final void createWarn(String title) { + createWarn(title, null); + } + + /** + * Create warning dialog + * + * @param title + * @param info + */ + public final void createWarn(String title, String info) { + super.setTitle(strTitle + " " + title); + setModal(true); + setCancelVisible(true); + jProgressBar.setVisible(false); + FontMetrics fm = getFontMetrics(getFont()); + int width = fm.stringWidth(getTitle()); + if (width > getWidth()) { + setSize(width, getHeight()); + } + jTextInfo.setFont(fontDefault); + jTextInfo.setForeground(fg); + jTextInfo.setText(""); + if (info != null) { + jTextInfo.setText(info); + } + setLocationRelativeTo(parent); + jTextInfo.setCaretPosition(0); + } + + /** + * Create progress bar dialog + * + * @param title + * @param info + */ + public final void createProgress(String title, String info) { + super.setTitle(strTitle + " " + title); + setModal(true); + setCancelVisible(true); + jProgressBar.setVisible(true); + FontMetrics fm = getFontMetrics(getFont()); + int width = fm.stringWidth(getTitle()); + if (width > getWidth()) { + setSize(width, getHeight()); + } + jTextInfo.setFont(fontDefault); + jTextInfo.setForeground(fg); + jTextInfo.setText(""); + if (info != null) { + jTextInfo.setText(info); + } + setLocationRelativeTo(parent); + jTextInfo.setCaretPosition(0); + } + + /** + * Overridable handle for a progress based task + * + * @param status + * @param jpb + */ + public void progressTask(int status, JProgressBar jpb) { + } + + /** + * Create error dialog + * + * @param title + */ + public final void createError(String title) { + createError(title, null); + } + + /** + * Create error dialog + * + * @param title + * @param info + */ + public final void createError(String title, String info) { + super.setTitle(strTitle + " " + title); + setModal(true); + setCancelVisible(false); + setContinueButtonText(strButtClose); + jProgressBar.setVisible(false); + FontMetrics fm = getFontMetrics(getFont()); + int width = fm.stringWidth(getTitle()); + if (width > getWidth()) { + setSize(width, getHeight()); + } + jTextInfo.setFont(fontDefault); + jTextInfo.setForeground(fg); + jTextInfo.setText(""); + if (info != null) { + jTextInfo.setText(info); + } + setLocationRelativeTo(parent); + jTextInfo.setCaretPosition(0); + } + + public final void setTimeLock(final int secs) { + jButtonCancel.setEnabled(false); + jButtonContinue.setEnabled(false); + this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); + final String buttontext = jButtonCancel.getText(); + tmrButtonLock = new Timer(1000, new java.awt.event.ActionListener() { + int localsecs = secs; + + @Override + public void actionPerformed(ActionEvent e) { + localsecs--; + if (localsecs == 0) { + tmrButtonLock.stop(); + jButtonCancel.setText(buttontext); + jButtonCancel.setEnabled(true); + jButtonContinue.setEnabled(true); + } else { + jButtonCancel.setText(buttontext + " (" + localsecs + ")"); + } + } + }); + jButtonCancel.setText(buttontext + " (" + secs + ")"); + tmrButtonLock.start(); + } + + public final void setCloseButtonText(String text) { + strButtClose = text; + } + + public final void setCancelButtonText(String text) { + jButtonCancel.setText(text); + } + + public final void setContinueButtonText(String text) { + jButtonContinue.setText(text); + } + + public final void setCheckBoxText(String text) { + jCheckBoxOption.setText(text); + } + + /** + * Enable/Disable Autoscrolling + * + * @param enabled + */ + public final void setAutoScrollEnabled(boolean enabled) { + jTextInfo.setAutoscrolls(enabled); + } + + /** + * Append text to the information area, Scrolling should be enabled + * + * @param text + */ + public final void appendInfoText(String text) { + jTextInfo.append(text); + jTextInfo.setCaretPosition(jTextInfo.getText().length()); + } + + /** + * Set whether the forms checkbox is enabled + * + * @param enabled + */ + public final void setCheckBoxVisible(boolean enabled) { + jCheckBoxOption.setVisible(enabled); + } + + /** + * Set check box selection status + * + * @param checked + */ + public final void setCheckBoxEnabled(boolean checked) { + jCheckBoxOption.setSelected(checked); + } + + /** + * Test to see if checkbox is selected + * + * @return boolean True if selected + */ + public final boolean isCheckBoxSelected() { + return jCheckBoxOption.isSelected(); + } + + /** + * Set info font + * + * @param font + * @param sizeoffset + */ + public final void setFont(String font, int sizeoffset) { + jTextInfo.setFont(new Font(font, jTextInfo.getFont().getStyle(), + jTextInfo.getFont().getSize() + sizeoffset)); + } + + /** + * Set the form auto close period in milliseconds + * + * @param millis + */ + public final void setAutoClose(int millis) { + tmrAutoClose = new Timer(millis, new java.awt.event.ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + tmrAutoClose.stop(); + doClose(CANCEL_WINDOW); + } + }); + tmrAutoClose.start(); + } + + public final JTextArea getTextArea() { + return jTextInfo; + } + + /** + * @return the return status of this dialog - one of RET_OK or RET_CANCEL + */ + public final int getReturnStatus() { + return returnStatus; + } + + /** + * Set dialog message body + * + * @param text + */ + public final void setInfoText(String text) { + jTextInfo.setText(text); + } + + /** + * Set dialog message body, and font colour + * + * @param text + * @param fgcolor + */ + public final void setInfoText(String text, Color fgcolor) { + jTextInfo.setForeground(fgcolor); + jTextInfo.setText(text); + } + + /** + * Set whether Cancel button is enabled + * + * @param enabled + */ + public final void setCancelEnabled(boolean enabled) { + jButtonCancel.setEnabled(enabled); + } + + /** + * Set whether Cancel button is visible + * + * @param visible + */ + public final void setCancelVisible(boolean visible) { + jButtonCancel.setVisible(visible); + } + + /** + * Set whether Ok button is enabled + * + * @param enabled + */ + public final void setAckEnabled(boolean enabled) { + jButtonContinue.setEnabled(enabled); + } + + /** + * Set whether OK button is visible + * + * @param visible + */ + public final void setAckVisible(boolean visible) { + jButtonContinue.setVisible(visible); + } + + public void setVisibleWithFocus(boolean visible) { + super.setVisible(visible); + this.requestFocus(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jPanelMain = new javax.swing.JPanel(); + jButtonCancel = new javax.swing.JButton(); + jCheckBoxOption = new javax.swing.JCheckBox(); + jButtonContinue = new javax.swing.JButton(); + jScrollPane2 = new javax.swing.JScrollPane(); + jTextInfo = new javax.swing.JTextArea(); + jProgressBar = new javax.swing.JProgressBar(); + + setMinimumSize(new java.awt.Dimension(410, 165)); + setResizable(false); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowClosing(java.awt.event.WindowEvent evt) { + closeDialog(evt); + } + }); + + jPanelMain.setFont(jPanelMain.getFont().deriveFont(jPanelMain.getFont().getStyle() | java.awt.Font.BOLD, jPanelMain.getFont().getSize()+2)); + jPanelMain.setOpaque(false); + + jButtonCancel.setText("Cancel"); + jButtonCancel.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonCancelActionPerformed(evt); + } + }); + + jCheckBoxOption.setText("Disable this notification."); + + jButtonContinue.setText("Continue"); + jButtonContinue.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonContinueActionPerformed(evt); + } + }); + + jTextInfo.setEditable(false); + jTextInfo.setColumns(20); + jTextInfo.setLineWrap(true); + jTextInfo.setRows(5); + jTextInfo.setWrapStyleWord(true); + jScrollPane2.setViewportView(jTextInfo); + + jProgressBar.setString(""); + jProgressBar.setStringPainted(true); + + javax.swing.GroupLayout jPanelMainLayout = new javax.swing.GroupLayout(jPanelMain); + jPanelMain.setLayout(jPanelMainLayout); + jPanelMainLayout.setHorizontalGroup( + jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelMainLayout.createSequentialGroup() + .addComponent(jCheckBoxOption) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE) + .addComponent(jButtonCancel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonContinue)) + .addComponent(jScrollPane2) + .addComponent(jProgressBar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + jPanelMainLayout.setVerticalGroup( + jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelMainLayout.createSequentialGroup() + .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jCheckBoxOption) + .addComponent(jButtonContinue) + .addComponent(jButtonCancel))) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanelMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanelMain, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + private void jButtonCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed + doClose(CANCEL_BUTTON); + }//GEN-LAST:event_jButtonCancelActionPerformed + + /** + * Closes the dialog + */ + private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog + if (tmrButtonLock == null || !tmrButtonLock.isRunning()) { + doClose(CANCEL_WINDOW); + } + }//GEN-LAST:event_closeDialog + + private void jButtonContinueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonContinueActionPerformed + doClose(OK); + }//GEN-LAST:event_jButtonContinueActionPerformed + + private void doClose(int retStatus) { + if (jProgressBar.isVisible()) { + progressTask(retStatus, jProgressBar); + return; + } + if (tmrAutoClose != null) { + tmrAutoClose.stop(); + tmrAutoClose = null; + } + if (tmrButtonLock != null) { + tmrButtonLock.stop(); + tmrButtonLock = null; + } + returnStatus = retStatus; + setVisible(false); + dispose(); + } + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButtonCancel; + private javax.swing.JButton jButtonContinue; + private javax.swing.JCheckBox jCheckBoxOption; + private javax.swing.JPanel jPanelMain; + private javax.swing.JProgressBar jProgressBar; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JTextArea jTextInfo; + // End of variables declaration//GEN-END:variables + private int returnStatus = CANCEL_BUTTON; +} diff --git a/src/lib/Localisation.java b/src/lib/Localisation.java new file mode 100644 index 0000000..56bae48 --- /dev/null +++ b/src/lib/Localisation.java @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 as published by + * the Free Software Foundation. + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +package lib; + +import java.util.Locale; +import java.util.ResourceBundle; + +/** + * + * @author Alistair Neil, + */ +public final class Localisation { + + // Private Stuff + private final ResourceBundle resourceBundle; + private String encoding = null; + + public Localisation(String resource) { + String strSupportedLangs = "fr,en,pt"; + encoding = this.getString("encoding"); + if (!strSupportedLangs.contains(getLocale().getLanguage())) { + Locale.setDefault(new Locale("en", "GB")); + resourceBundle = ResourceBundle.getBundle(resource, Locale.getDefault()); + } else { + resourceBundle = ResourceBundle.getBundle(resource); + } + } + + /** + * Get the locale + * + * @return The locale + */ + public Locale getLocale() { + return Locale.getDefault(); + } + + public String toWebLanguageTag() { + return getLocale().toLanguageTag().replace('-', '_'); + } + + /** + * Get the country name for supplied iso2 code + * + * @param iso2 + * @return Localised country name + */ + public String getDisplayCountry(String iso2) { + switch (iso2) { + case "A1": + case "A2": + case "O1": + case "U1": + return getString("iso" + iso2); + default: + Locale obj = new Locale("", iso2); + return obj.getDisplayCountry(); + } + } + + /** + * Get localised string using given key + * + * @param key + * @return localised string + */ + public String getString(String key) { + try { + if (!encoding.contentEquals("encoding")) { + byte[] text = resourceBundle.getString(key).getBytes("ISO8859-1"); + return new String(text, encoding); + } else { + return resourceBundle.getString(key); + } + } catch (Exception ex) { + } + return key; + } + + /** + * Get an array of localised strings using a key array or multiple keys + * + * @param keys + * @return localised string array + */ + public String[] getStrings(String... keys) { + + String[] result = new String[keys.length]; + int i = 0; + for (String key : keys) { + result[i++] = getString(key); + } + return result; + } +} diff --git a/src/lib/NetFunctions.java b/src/lib/NetFunctions.java new file mode 100644 index 0000000..d86c595 --- /dev/null +++ b/src/lib/NetFunctions.java @@ -0,0 +1,430 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.Proxy; +import java.net.Socket; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.Locale; +import java.util.TimeZone; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JProgressBar; + +/** + * + * @author Alistair Neil, + */ +public class NetFunctions { + + public static final int CONNECTION_FAILED = 0; + public static final int FILE_LOCAL_ISNEWER = 1; + public static final int FILE_RETRIEVED = 2; + public static final int FILE_FAILED = 3; + public static final int EVENT_URLOK = 1; + public static final int EVENT_URLFAILED = 2; + public static final int EVENT_NETLATENCY = 3; + public static final long LATENCY_FAIL = 9999; + public static final long LATENCY_UNKNOWN = 0; + private int intSocketTimeout = 8000; + private JProgressBar jpb; + + public NetFunctions() { + } + + /** + * Set default socket timeout + * + * @param timeout + */ + public void setSocketTimeout(int timeout) { + intSocketTimeout = timeout; + } + + public void setProgressBar(JProgressBar jpb) { + this.jpb = jpb; + } + + /** + * Save the contents of a URL to a file + * + * @param destfile File destination path + * @param sourceurl URL + * @param socket + * @param force Forces update regardless of age + * @return int File retieval status code + */ + public int saveURLContentToFile(String destfile, String sourceurl, Socket socket, boolean force) { + // Get a handle to our local file + File f = new File(destfile); + InputStream is = openStreamToURL(sourceurl, socket); + HttpPage hp = new HttpPage(is); + int result = FILE_FAILED; + try { + socket.setSoTimeout(intSocketTimeout); + hp.retrieveHeader(); + if (hp.isHeaderOK()) { + result = FILE_LOCAL_ISNEWER; + if (hp.getLastModified() > f.lastModified() || force) { + if (hp.saveBodyToFile(destfile, jpb)) { + result = FILE_RETRIEVED; + Logger.getGlobal().logp(Level.INFO, this.getClass().getName(), "saveURLContentToFile", "Http body content retrieved"); + } else { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "saveURLContentToFile", "Failed to retrieve Http body content"); + } + } + } else { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "saveURLContentToFile", "Failed to retrieve Http header"); + } + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "saveURLContentToFile", ex.getMessage()); + } finally { + try { + is.close(); + socket.close(); + } catch (Exception ex) { + } + } + return result; + } + + /** + * Make sure ipaddress is valid number + * + * @param ipaddress + * @return true if a valid ip address + */ + public boolean isIPAddress(String ipaddress) { + ipaddress = ipaddress.replace(".", ""); + try { + Long.parseLong(ipaddress); + return true; + } catch (NumberFormatException ex) { + } + return false; + } + + /** + * Get latency non threaded version + * + * @param surl Testing url + * @param proxy Specify a proxy, null == no proxy + * @param timeout Specify a timeout before declaring failure + * @return long latency in milliseconds + */ + public long getLatency(String surl, Proxy proxy, int timeout) { + + long lngStart; + long lngResult; + HttpURLConnection conn = null; + + try { + URL url = new URL(surl); + if (proxy == null) { + conn = (HttpURLConnection) url.openConnection(); + } else { + conn = (HttpURLConnection) url.openConnection(proxy); + } + conn.setDoInput(true); + conn.setDefaultUseCaches(false); + conn.setConnectTimeout(timeout); + lngStart = System.currentTimeMillis(); + conn.connect(); + lngResult = System.currentTimeMillis() - lngStart; + } catch (IOException ex) { + lngResult = LATENCY_FAIL; + Logger.getGlobal().log(Level.WARNING, "getLatency {0}", ex.getMessage()); + } + if (conn != null) { + conn.disconnect(); + } + return lngResult; + } + + /** + * Check web for updates and return version string if an update is available + * + * @param sourceurl URL to check + * @param s Socket + * @return String new version number + */ + public String getURLContentAsString(String sourceurl, Socket s) { + + String result = null; + try { + s.setSoTimeout(intSocketTimeout); + try (InputStream is = openStreamToURL(sourceurl, s)) { + HttpPage hp = new HttpPage(is); + hp.retrieveHeader(); + if (hp.isHeaderOK()) { + result = hp.getBodyAsString(); + } + is.close(); + } + } catch (Exception ex) { + Logger.getGlobal().log(Level.WARNING, "getURLAsString", ex.getMessage()); + result = null; + } finally { + try { + s.close(); + } catch (Exception ex) { + } + } + return result; + } + + /** + * Open an inputstream to the given url on the given socket + * + * @param surl + * @param s + * @return inputstream + */ + public InputStream openStreamToURL(String surl, Socket s) { + URI uri; + try { + uri = new URI(surl); + String host = uri.getHost(); + String path = uri.getRawPath(); + if (path == null) { + return null; + } + + PrintWriter request = new PrintWriter(s.getOutputStream()); + request.print("GET " + path + " HTTP/1.1\r\n" + + "Host: " + host + "\r\n" + + "Connection: close\r\n\r\n" + ); + + request.flush(); + InputStream inStream = s.getInputStream(); + return inStream; + } catch (URISyntaxException | IOException ex) { + } + return null; + } + + /** + * Store an http formatted web page + */ + public static final class HttpPage { + + public static final String PATTERN_RFC1123 = "EEE, dd MMM yyyy HH:mm:ss zzz"; + public static final String PATTERN_RFC1036 = "EEEE, dd-MMM-yy HH:mm:ss zzz"; + public static final String PATTERN_ASCTIME = "EEE MMM d HH:mm:ss yyyy"; + private final TimeZone GMT = TimeZone.getTimeZone("GMT"); + private final SimpleDateFormat format = new SimpleDateFormat("", Locale.US); + private final HashMap hm = new HashMap<>(); + private final InputStream israw; + + /** + * Store webpage from the given input stream + * + * @param is + */ + public HttpPage(InputStream is) { + format.setTimeZone(GMT); + israw = is; + } + + private String readLine(InputStream is) { + byte data; + String line = ""; + String term = ""; + try { + while (!"\r\n".equals(term)) { + data = (byte) is.read(); + if (data == -1) { + return null; + } + line += String.valueOf((char) data); + if (((char) data) == '\r' || ((char) data) == '\n') { + term += String.valueOf((char) data); + } else { + term = ""; + } + } + line = line.trim(); + } catch (Exception ex) { + line = null; + } + return line; + } + + /** + * Retrieve http header info + */ + public final void retrieveHeader() { + int colonpos; + String key; + String value; + String line; + try { + line = readLine(israw); + hm.put("Header-Response", line); + while (true) { + line = readLine(israw); + if (line.isEmpty()) { + if (hm.get("Content-Length") == null) { + line = readLine(israw); + if (!line.isEmpty()) { + try { + long contentsize = Long.parseLong(line, 16); + hm.put("Content-Length", String.valueOf(contentsize)); + } catch (Exception ex) { + } + } + } + break; + } + colonpos = line.indexOf(':'); + key = line.substring(0, colonpos); + value = line.substring(colonpos + 1); + hm.put(key, value.trim()); + } + } catch (Exception ex) { + Logger.getGlobal().log(Level.WARNING, "retrieveHeader()", ex.getMessage()); + hm.clear(); + } + } + + /** + * Retrieve http body as string should only be used with text content + * + * @return null if failed, otherwise returns the contents + */ + public final String getBodyAsString() { + String result = ""; + try { + String temp = hm.get("Content-Length"); + if (temp == null) { + return null; + } + long contentsize = Long.parseLong(temp); + while (contentsize-- != 0) { + result += (char) israw.read(); + } + } catch (NumberFormatException | IOException ex) { + result = null; + Logger.getGlobal().log(Level.WARNING, "getBodyAsString()", ex.getMessage()); + } + return result; + } + + /** + * Save http body to a file, applies to all types of content + * + * @param dest File destination + * @param jpb Progress bar + * @return true if successful + */ + public final boolean saveBodyToFile(String dest, JProgressBar jpb) { + try { + String temp = hm.get("Content-Length"); + if (temp == null) { + return false; + } + long contentsize = Long.parseLong(temp); + long bytereset = contentsize / 102; + long bytecount = bytereset; + int progress = 0; + File f = new File(dest); + try (FileOutputStream fos = new FileOutputStream(f)) { + if (jpb != null) { + jpb.setString(null); + } + while (contentsize-- != 0) { + fos.write(israw.read()); + if (bytecount-- == 0) { + bytecount = bytereset; + if (jpb != null) { + jpb.setValue(progress++); + } + } + } + fos.close(); + return true; + } + } catch (NumberFormatException | IOException ex) { + Logger.getGlobal().log(Level.WARNING, "saveBody()", ex.getMessage()); + } + return false; + } + + /** + * Get various properties of the web page + * + * @param key + * @return property string + */ + public final String getProperty(String key) { + return hm.get(key); + } + + private long getHttpDate(String adate) { + try { + format.applyPattern(PATTERN_RFC1123); + return format.parse(adate).getTime(); + } catch (Exception ex) { + } + try { + format.applyPattern(PATTERN_RFC1036); + return format.parse(adate).getTime(); + } catch (Exception ex) { + } + try { + format.applyPattern(PATTERN_ASCTIME); + return format.parse(adate).getTime(); + } catch (Exception ex) { + } + return -1; + } + + public final long getLastModified() { + return getHttpDate(hm.get("Last-Modified")); + } + + public final long getServerDate() { + return getHttpDate(hm.get("Date")); + } + + public final long getExpires() { + return getHttpDate(hm.get("Expires")); + } + + public final boolean isHeaderOK() { + String temp = hm.get("Content-Length"); + if (temp == null) { + return false; + } + temp = hm.get("Header-Response"); + if (temp == null) { + return false; + } + return temp.contains("200 OK"); + } + + } + +} diff --git a/src/lib/OSFunction.java b/src/lib/OSFunction.java new file mode 100644 index 0000000..0ff6fc3 --- /dev/null +++ b/src/lib/OSFunction.java @@ -0,0 +1,870 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import java.util.ArrayList; +import java.util.Locale; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * + * @author Alistair Neil + */ +public class OSFunction { + + private static ArrayList alProcesses; + + /** + * Get process id + * + * @return Process id or -1 if not found + */ + public static String getOurProcessID() { + RuntimeMXBean rtb = ManagementFactory.getRuntimeMXBean(); + String processName = rtb.getName(); + Integer pid = tryPattern(processName); + return String.valueOf(pid); + } + + /** + * Get process id from a process + * + * @param process + * @return process id as String + */ + public static String getProcessID(String process) { + Pattern pattern = Pattern.compile(" +"); + String[] result = pattern.split(process.trim()); + if (isWindows()) { + return result[1]; + } else { + return result[0]; + } + } + + private static Integer tryPattern(String processName) { + Integer result = null; + Pattern pattern = Pattern.compile("^([0-9]+)@.+$", Pattern.CASE_INSENSITIVE); + Matcher matcher = pattern.matcher(processName); + if (matcher.matches()) { + result = Integer.parseInt(matcher.group(1)); + } + return result; + } + + /** + * Get OS version + * + * @return String OS version + */ + public static String getOSVersion() { + return System.getProperty("os.version"); + } + + /** + * Get user name + * + * @return String User name + */ + public static String getUserName() { + return System.getProperty("user.name"); + } + + /** + * Get users home folder + * + * @return String path to home folder + */ + public static String getUsersHomeFolder() { + return System.getProperty("user.home"); + } + + /** + * Get file separator + * + * @return String separator + */ + public static String getFileSeparator() { + return System.getProperty("file.separator"); + } + + /** + * Get users documents folder (Windows only) + * + * @return String path to documents folder + */ + public static String getUsersDocFolder() { + + String strReturn = getUsersHomeFolder() + "\\Documents"; + if (isWinXP()) { + strReturn = getUsersHomeFolder() + "\\My Documents"; + } + return strReturn; + } + + /** + * Get user settings path + * + * @return String path to user settings folder + */ + public static String getUserSettingsPath() { + + String userSettingsPath; + if (isWindows()) { + userSettingsPath = getUsersHomeFolder() + "\\Application Data\\"; + } else { + userSettingsPath = getUsersHomeFolder() + "/"; + } + return userSettingsPath; + } + + /** + * Get a specified application's settings folder, if null return this + * applications setting folder + * + * @param appname Application settings folder name + * @param appseries Application series (optional) + * @return String Path to the applications setting folder + */ + public static String getAppSettingsPath(String appname, String appseries) { + + String appSettingsPath = getUserSettingsPath(); + if (appname == null) { + return appSettingsPath; + } + if (isLinux()) { + appname = "." + appname; + } + appSettingsPath += appname + getFileSeparator(); + if (appseries != null) { + appSettingsPath += appseries + getFileSeparator(); + } + return appSettingsPath; + } + + /** + * Get users current folder + * + * @return String Path to current folder + */ + public static String getUsersCurrentFolder() { + return System.getProperty("user.dir"); + } + + /** + * Get users temp folder + * + * @param path + * @return String Path to users temp folder + */ + public static String getTempFolder(String path) { + String result = System.getProperty("java.io.tmpdir"); + String sep = ""; + if (isLinux()) { + sep = getFileSeparator(); + } + result += sep; + if (path != null && !path.isEmpty()) { + if (isWindows()) { + sep = getFileSeparator(); + } + result = result + path + sep; + } + return result; + } + + /** + * Get OS name, convenience method + * + * @return String + */ + public static String getOSName() { + return System.getProperty("os.name").toLowerCase(); + } + + /** + * Get OS architecture, convenience method + * + * @return String + */ + public static String getOSArch() { + return System.getProperty("os.arch"); + } + + /** + * Generic test for Windows platform + * + * @return boolean True if Windows + */ + public static boolean isWindows() { + return getOSName().contains("windows"); + } + + /** + * Specific test for Win 7 + * + * @return boolean True if Win 7 + */ + public static boolean isWin7() { + return getOSName().startsWith("windows 7"); + } + + /** + * Specific test for Win 8 + * + * @return boolean True if Win 8 + */ + public static boolean isWin8() { + return getOSName().startsWith("windows 8"); + } + + /** + * Specific test for Win 10 + * + * @return boolean True if Win 10 + */ + public static boolean isWin10() { + return getOSName().startsWith("windows 10"); + } + + /** + * Specific test for Win XP + * + * @return boolean True if Win XP + */ + public static boolean isWinXP() { + return getOSName().contentEquals("windows"); + } + + /** + * Generic test for Linux platform + * + * @return boolean True if Linux + */ + public static boolean isLinux() { + return getOSName().contains("linux"); + } + + /** + * Find a specific file, requires a series of paths where it might be found + * to be provided + * + * @param fname + * @param paths + * @return String path to file or null + */ + public static String findFile(String fname, String... paths) { + for (String s : paths) { + if (new File(s + fname).exists()) { + return s + fname; + } + } + return null; + } + + /** + * Test to see if their are multiple instances of the this app running + * + * @param appname + * @return True if multiple instance + */ + public static boolean isMultipleInstance(String appname) { + if (alProcesses == null) { + alProcesses = getLiveProcesses(); + } + ArrayList processes = OSFunction.filterProcesses(appname); + return OSFunction.filterProcesses(processes, "java").size() > 1; + } + + /** + * Cached list of processes + * + * @return list + */ + public static ArrayList getCachedProcesses() { + return alProcesses; + } + + /** + * Find processes matching the contents of filter + * + * @param processes + * @param filter + * @return ArrayList of matching processes + */ + public static ArrayList filterProcesses(ArrayList processes, String filter) { + ArrayList result = new ArrayList<>(); + if (processes != null && !processes.isEmpty()) { + if (filter != null) { + for (String s : processes) { + if (s.contains(filter)) { + result.add(s); + } + } + } + } + return result; + } + + /** + * Find processes matching the contents of filter + * + * @param filter + * @return ArrayList of matching processes + */ + public static ArrayList filterProcesses(String filter) { + ArrayList result = new ArrayList<>(); + if (!alProcesses.isEmpty()) { + if (filter != null) { + for (String s : alProcesses) { + if (s.contains(filter)) { + result.add(s); + } + } + } + } + return result; + } + + /** + * Generic kill process with matching pid + * + * @param pid + * @return String kill result or null if failed + */ + public static String killProcess(String pid) { + if (isWindows()) { + return killProcessWindows(pid); + } + if (isLinux()) { + return killProcessLinux(pid); + } + return null; + } + + /** + * Windows specific kill process with matching pid + * + * @param pid + * @return String kill result or null if failed + */ + private static String killProcessWindows(String pid) { + Process processKill; + try { + processKill = Runtime.getRuntime().exec("taskkill /F /pid " + pid); + return getProcessResult(processKill); + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, OSFunction.class.getName(), "killProcessWindows", "", ex); + } + try { + processKill = Runtime.getRuntime().exec("tskill " + pid); + return getProcessResult(processKill); + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, OSFunction.class.getName(), "killProcessWindows", "", ex); + } + return null; + } + + /** + * Linux specific specific kill process with matching pid + * + * @param pid + * @return String kill result or null if failed + */ + private static String killProcessLinux(String pid) { + Process processKill = null; + try { + processKill = Runtime.getRuntime().exec("kill -9 " + pid); + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, OSFunction.class.getName(), "killProcessLinux", "", ex); + } + return getProcessResult(processKill); + } + + /** + * Set a files hidden status (Windows only) + * + * @param filepath Path to file includes filename + * @param hidden True/False + */ + public static void setFileHidden(String filepath, boolean hidden) { + + if (isWindows()) { + try { + if (hidden) { + Runtime.getRuntime().exec("Attrib.exe +H " + filepath).waitFor(); + } else { + Runtime.getRuntime().exec("Attrib.exe -H " + filepath).waitFor(); + } + } catch (IOException | InterruptedException ex) { + Logger.getGlobal().logp(Level.WARNING, OSFunction.class.getName(), "setFileHidden", "", ex); + } + } + } + + /** + * Get gnome 3 preference using schema name and key name + * + * @param schema + * @param key + * @return String preference value + */ + public static String getGnome3Pref(String schema, String key) { + Process p = launchProcess("gsettings", "get", schema, key); + String result = getProcessResult(p); + if (result != null) { + result = result.replace("'", "").replace("[", "").replace("]", ""); + } + return result; + } + + /** + * Set a gnome 3 boolean value using schema name and key name + * + * @param schema + * @param key + * @param value + */ + public static void setGnome3Pref(String schema, String key, boolean value) { + setGnome3Pref(schema, key, String.valueOf(value)); + } + + /** + * Set a gnome 3 string value using schema name and key name + * + * @param schema + * @param key + * @param value + */ + public static void setGnome3Pref(String schema, String key, String value) { + if (value == null || value.isEmpty()) { + resetGnome3Pref(schema, key); + } else { + launchProcess("gsettings", "set", schema, key, "'" + value + "'"); + } + } + + /** + * Reset a gnome3 value to its default. If key is null, it will reset the + * whole schema tree to its defaults + * + * @param schema + * @param key + */ + public static void resetGnome3Pref(String schema, String key) { + if (key == null) { + launchProcess("gsettings", "reset", schema); + } else { + launchProcess("gsettings", "reset", schema, key); + } + } + + /** + * Get a kde preference string value using group name, key name and return + * contents of def on failure + * + * @param group + * @param key + * @param def + * @return String Preference value + */ + public static String getKDEPref(String group, String key, String def) { + + // If exists read the file contents and find the matching key + String strKdePath = getKDEProxyPath(); + if (strKdePath == null) { + return null; + } + + String strTemp = null; + SimpleFile sf = new SimpleFile(strKdePath); + sf.openBufferedRead(); + while ((strTemp = sf.readLine()) != null) { + if (strTemp.contains("[" + group + "]")) { + break; + } + } + if (strTemp == null) { + return def; + } + while ((strTemp = sf.readLine()) != null) { + if (strTemp.contains(key)) { + break; + } + } + sf.closeFile(); + if (strTemp == null) { + return def; + } + strTemp = strTemp.substring(strTemp.indexOf('=') + 1); + return strTemp; + } + + /** + * Set a kde string preference value using group name, key name + * + * @param group + * @param key + * @param value + */ + public static void setKDEPref(String group, String key, String value) { + + // If exists read the file contents and find the matching key + String strKdePath = getKDEProxyPath(); + if (strKdePath == null) { + return; + } + + SimpleFile sf = new SimpleFile(strKdePath); + // Get file contents into a array list for further processing + String strTemp; + ArrayList listContents = new ArrayList<>(); + sf.openBufferedRead(); + while ((strTemp = sf.readLine()) != null) { + listContents.add(strTemp); + } + sf.closeFile(); + + // Process contents of file and write it back out + sf.openBufferedWrite(); + // Find Group entry + boolean entryfound = false; + while (!listContents.isEmpty()) { + strTemp = listContents.get(0); + sf.writeFile(strTemp, 1); + listContents.remove(0); + if (strTemp.contentEquals("[" + group + "]")) { + entryfound = true; + break; + } + } + + // If no group entry found then write one + if (!entryfound) { + sf.writeFile("", 1); + sf.writeFile("[" + group + "]", 1); + } + + // Find key entry + while (!listContents.isEmpty()) { + strTemp = listContents.get(0); + listContents.remove(0); + if (strTemp.contains(key)) { + break; + } + sf.writeFile(strTemp, 1); + } + + sf.writeFile(key + "=" + value, 1); + + // Write out rest of file + while (!listContents.isEmpty()) { + strTemp = listContents.get(0); + listContents.remove(0); + sf.writeFile(strTemp, 1); + } + sf.closeFile(); + } + + /** + * Set a kde boolean preference value using group name, key name + * + * @param group + * @param key + * @param value + */ + public static void setKDEPref(String group, String key, boolean value) { + setKDEPref(group, key, String.valueOf(value)); + } + + /** + * Set a kde integer preference value using group name, key name + * + * @param group + * @param key + * @param value + */ + public static void setKDEPref(String group, String key, int value) { + setKDEPref(group, key, String.valueOf(value)); + } + + /** + * Test for KDE installed (Linux only) + * + * @return String path to kde proxy file or null + */ + public static String getKDEProxyPath() { + if (isLinux()) { + File f = new File(getUsersHomeFolder() + "/.config/kioslaverc"); + if (f.exists()) { + return f.getAbsolutePath(); + } + f = new File(getUsersHomeFolder() + "/.kde/share/config/kioslaverc"); + if (f.exists()) { + return f.getAbsolutePath(); + } + f = new File(getUsersHomeFolder() + "/.kde4/share/config/kioslaverc"); + if (f.exists()) { + return f.getAbsolutePath(); + } + } + return null; + } + + /** + * Test if gsettings installed (Linux only) + * + * @return String path to gsetttings + */ + public static String getGsettingsPath() { + // Verify if gsettings is installed + return findFile("gsettings", "/usr/bin/"); + } + + /** + * Convenience method to get the first resultant output of an executed + * process as a String + * + * @param aprocess + * @return String Process result + */ + public static String getProcessResult(Process aprocess) { + if (aprocess == null) { + return null; + } + return getProcessOutput(aprocess.getInputStream()).toString(); + } + + /** + * Obtain all output of an executed process. + * + * @param is + * @return ArrayList of Strings containing all generated output + */ + public static ArrayList getProcessOutput(InputStream is) { + + String line; + ArrayList arrList = new ArrayList<>(); + try { + try (BufferedReader input = new BufferedReader(new InputStreamReader(is))) { + while ((line = input.readLine()) != null) { + if (line.isEmpty()) { + continue; + } + arrList.add(line); + } + } + return arrList; + } catch (IOException ex) { + Logger.getGlobal().logp(Level.SEVERE, OSFunction.class.getName(), "getProcessResults", "", ex); + } + return null; + } + + /** + * Launch an external process with arguments + * + * @param command + * @return Process + */ + public static Process launchProcess(String... command) { + try { + Process p = Runtime.getRuntime().exec(command); + if (p == null) { + Logger.getGlobal().logp(Level.WARNING, OSFunction.class.getName(), "launchProcess", "Failed Process", ""); + } + return p; + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, OSFunction.class.getName(), "launchProcess", "", ex); + } + return null; + } + + /** + * Gets list of active system processes + * + * @return Arraylist of system process + */ + public static ArrayList getLiveProcesses() { + if (isWindows()) { + return getActiveProcessesWindows(); + } else { + return getActiveProcessesLinux(); + } + } + + /** + * Windows specific refresh or internal list of active system processes + */ + private static ArrayList getActiveProcessesWindows() { + ArrayList alResult = new ArrayList<>(); + try { + Logger.getGlobal().info("refreshActiveProcessesWindows()"); + Process p = Runtime.getRuntime().exec(System.getenv("windir") + "\\system32\\" + "tasklist.exe /v"); + alResult = getProcessOutput(p.getInputStream()); + if (alResult.size() > 1) { + // Remove second entry + alResult.remove(1); + } + return alResult; + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, OSFunction.class.getName(), "refreshActiveProcessesWindows", "", ex); + } + return alResult; + } + + /** + * Linux specific refresh or internal list of active system processes + */ + private static ArrayList getActiveProcessesLinux() { + + ArrayList alResult = new ArrayList<>(); + try { + Process process = Runtime.getRuntime().exec("ps ax"); + alResult = getProcessOutput(process.getInputStream()); + return alResult; + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, OSFunction.class.getName(), "refreshActiveProcessesLinux", "", ex); + } + return alResult; + } + + /** + * Get the name of the compositor + * + * @return name as String + */ + public static String getCompositor() { + String result = "unknown"; + if (isWin7() || isWin8() || isWin10()) { + return "DWM"; + } + if (isWindows()) { + return getOSName(); + } + if (alProcesses == null) { + alProcesses = getLiveProcesses(); + } + for (String s : alProcesses) { + if (s.contains("kwin")) { + result = "kwin"; + break; + } + if (s.contains("compton")) { + result = "compton"; + break; + } + if (s.contains("cinnamon")) { + result = "clutter"; + break; + } + if (s.contains("marco")) { + result = "marco"; + break; + } + if (s.contains("compiz")) { + result = "compiz"; + break; + } + } + return result; + } + + /** + * Get the name of the active desktop + * + * @return name as String + */ + public static String getActiveDesktop() { + if (isWindows()) { + return getOSName(); + } + String result = "unknown"; + if (alProcesses == null) { + alProcesses = getLiveProcesses(); + } + for (String s : alProcesses) { + if (s.contains("cinnamon-session")) { + result = "cinnamon"; + break; + } + if (s.contains("xfce4-session")) { + result = "xfce"; + break; + } + if (s.contains("mate-session")) { + result = "mate"; + break; + } + if (s.contains("gnome-shell")) { + result = "gnome3"; + break; + } + if (s.contains("unity-settings-daemon")) { + result = "unity"; + break; + } + if (s.contains("lxsession")) { + result = "lxde"; + break; + } + if (s.contains("plasma-desktop")) { + result = "kde4"; + break; + } + if (s.contains("plasmashell")) { + result = "kde5"; + break; + } + if (s.contains("enlightenment")) { + result = "enlightenment"; + break; + } + } + return result; + } + + /** + * Clear active processes, mainly to reduce memory consumption when were + * done with them + */ + public static void clearActiveProcesses() { + alProcesses.clear(); + alProcesses = null; + } + + /** + * Get default language iso code + * + * @return language iso code + */ + public static String getLangCode() { + return Locale.getDefault().getLanguage(); + } + +} diff --git a/src/lib/SimpleFile.java b/src/lib/SimpleFile.java new file mode 100644 index 0000000..a83a2c8 --- /dev/null +++ b/src/lib/SimpleFile.java @@ -0,0 +1,895 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.io.*; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardCopyOption; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.Date; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +/** + * + * @author Alistair Neil info@dazzleships.net + */ +public class SimpleFile { + + public static final int PERIOD_MINUTES = 0; + public static final int PERIOD_HOURS = 1; + public static final int PERIOD_DAYS = 2; + public static final int NOTFOUND = 0; + public static final int FILEDELETEOK = 1; + public static final int FILEDELETEFAIL = 2; + private final int blockreadsize = 1024; + private BufferedReader br; + private BufferedWriter bw; + private ZipOutputStream zos; + private File f; + private String filter = ""; + + public SimpleFile() { + } + + /** + * Constructor + * + * @param pathname + */ + public SimpleFile(String pathname) { + f = new File(pathname); + } + + /** + * Set filename + * + * @param pathname + */ + public final void setFileName(String pathname) { + f = new File(pathname); + } + + /** + * Set file + * + * @param file + */ + public final void setFile(File file) { + f = file; + } + + /** + * Get file + * + * @return file + */ + public final File getFile() { + return f; + } + + /** + * Close file and any resources such as buffered readers/writers that are + * attached to it. + */ + public final void closeFile() { + if (br != null) { + try { + br.close(); + } catch (IOException ex) { + Logger.getLogger(SimpleFile.class.getName()).log(Level.SEVERE, null, ex); + } + br = null; + } + if (bw != null) { + try { + bw.close(); + } catch (IOException ex) { + Logger.getLogger(SimpleFile.class.getName()).log(Level.SEVERE, null, ex); + } + bw = null; + } + } + + /** + * Sets the file filter + * + * @param filter + */ + public final void setFileFilter(String filter) { + this.filter = filter; + } + + /** + * Gets the current file filter + * + * @return Returns the file filter + */ + public final String getFileFilter() { + return filter; + } + + public final static String getSeparator() { + return File.separator; + } + + /** + * Creates a new folder + * + * @return True if successful + */ + public final boolean createFolder() { + if (f.exists()) { + return true; + } + return f.mkdirs(); + } + + /** + * Creates a new folder + * + * @param path The location of the new folder + * @return True if successful + */ + public final static boolean createFolder(String path) { + File fl = new File(path); + if (fl.exists()) { + return true; + } + return fl.mkdirs(); + } + + /** + * Create a new file + * + * @return True if file exist or is created + */ + public final boolean createFile() { + boolean createNewFile = true; + if (!f.exists()) { + try { + createFolder(f.getParent()); + createNewFile = f.createNewFile(); + } catch (IOException ex) { + createNewFile = false; + } + } + return createNewFile; + } + + /** + * Gets the file list at the specified directory location based on filter + * contents + * + * @return An array of Files + */ + public final File[] getFileList() { + + File[] arrFilesCache; + if (filter.isEmpty()) { + arrFilesCache = f.listFiles(); + } else { + arrFilesCache = f.listFiles(new FileFilter() { + @Override + public boolean accept(File pathname) { + return pathname.getPath().contains(filter); + } + }); + } + return arrFilesCache; + } + + public final File getOldestFile() { + long lngLastAge = new Date().getTime(); + File oldest = null; + File[] arrFiles = getFileList(); + for (File fi : arrFiles) { + if (fi.lastModified() < lngLastAge) { + lngLastAge = fi.lastModified(); + oldest = fi; + } + } + return oldest; + } + + public final static void walkFileTree(String path, ArrayList files) { + walkFileTree(path, files, ""); + } + + public final static void walkFileTree(String path, ArrayList files, final String filter) { + + File[] arrFilesCache; + File root = new File(path); + if (filter.isEmpty()) { + arrFilesCache = root.listFiles(); + } else { + arrFilesCache = root.listFiles(new FileFilter() { + @Override + public boolean accept(File pathname) { + return pathname.getPath().contains(filter); + } + }); + } + + if (arrFilesCache == null) { + return; + } + + for (File f : arrFilesCache) { + if (f.isDirectory()) { + walkFileTree(f.getAbsolutePath(), files, filter); + } else { + files.add(f); + } + } + } + + /** + * Deletes the supplied list of files, be very carefull with this + * + * @param files + */ + public final void deleteFileList(File[] files) { + for (File fx : files) { + if (fx.isFile()) { + boolean delete = fx.delete(); + } + } + } + + /** + * Delete folder and its contents using specified folder path + * + * @param folder + * @return boolean True if successful + */ + public final static boolean deleteFolder(String folder) { + if (OSFunction.isLinux() && folder.contentEquals("/")) { + return false; + } + return deleteFolder(new File(folder)); + } + + /** + * Delete a folder and all of its contents works recursively + * + */ + private static boolean deleteFolder(File folder) { + if (!folder.exists()) { + return false; + } + for (File fx : folder.listFiles()) { + if (fx.isDirectory()) { + deleteFolder(fx); + } else { + boolean delete = fx.delete(); + } + } + return folder.delete(); + } + + /** + * Wipe folder and its contents using specified folder path + * + * @param folder + */ + public final static void secureWipeFolder(String folder) { + if (OSFunction.isLinux() && folder.contentEquals("/")) { + return; + } + secureWipeFolder(new File(folder)); + } + + /** + * Wipe folder and its contents using specified File + * + * @param folder + */ + public final static void secureWipeFolder(File folder) { + if (!folder.exists()) { + return; + } + for (File fx : folder.listFiles()) { + if (fx.isDirectory()) { + secureWipeFolder(fx); + } else { + secureWipe(fx); + } + } + folder = renameTo(folder, "0000000"); + folder.delete(); + } + + /** + * Wipe file using specified filename + * + * @param filename + */ + public final static void secureWipe(String filename) { + secureWipe(new File(filename)); + } + + /** + * Wipe file using specified File + * + * @param f + */ + public final static void secureWipe(File f) { + + if (!f.exists()) { + return; + } + + FileOutputStream fos = null; + byte b[] = new byte[4096]; + long i = f.length() / 4096; + int remainder = (int) (f.length() % 4096); + byte r[] = new byte[remainder]; + try { + // Overwrite with zeros + fos = new FileOutputStream(f, false); + while (i-- > 0) { + fos.write(b); + fos.flush(); + } + fos.write(r); + fos.close(); + // Zero file length + b = new byte[0]; + fos = new FileOutputStream(f, false); + fos.write(b); + + } catch (IOException ex) { + Logger.getLogger(SimpleFile.class + .getName()).log(Level.SEVERE, null, ex); + } finally { + try { + if (fos != null) { + fos.close(); + } + // Rename file + f = renameTo(f, "0000000000"); + // Delete file + f.delete(); + } catch (IOException ex) { + } + } + } + + public final static File renameTo(File f, String newname) { + String path = f.getParent(); + if (path != null) { + path += File.separator + newname; + File nf = new File(path); + if (f.renameTo(nf)) { + return nf; + } + } + return f; + } + + /** + * Copy multiple files from one folder to another + * + * @param from The from path + * @param to The to path + * @param ignore + */ + public final static void copyFolderContents(String from, String to, String ignore) { + try { + File ourFile = new File(from); + for (File fx : ourFile.listFiles()) { + if (!ignore.contains(fx.getName())) { + copyFromTo(fx.getAbsolutePath(), to + fx.getName()); + } + } + } catch (Exception ex) { + Logger.getGlobal().logp(Level.WARNING, "SimpleFile", "copyFolderContents()", "", ex); + } + } + + /** + * Returns an array of filenames, array if populated from the offset value + * onwards + * + * @param offset + * @return An array of filenames + */ + public final String[] getFilenames(int offset) { + + String filename; + File[] fileList = getFileList(); + String[] result = new String[fileList.length + offset]; + try { + for (int i = 0; i < fileList.length; i++) { + filename = fileList[i].getName(); + result[i + offset] = filename.substring(0, filename.indexOf('.')); + } + return result; + } catch (Exception ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "getFilenames(int offset)", "", ex); + return null; + } + } + + /** + * Test to see if path exists + * + * @return Returns true if file exists + */ + public final boolean exists() { + return f.exists(); + } + + /** + * Test to see if path exists + * + * @param pathname The pathname to check for + * @return Returns true if file exists + */ + public final static boolean exists(String pathname) { + return new File(pathname).exists(); + } + + /** + * Deletes file + * + * @return Returns true if successful + */ + public final boolean delete() { + return f.delete(); + } + + /** + * Deletes the specified file + * + * @param filename + * @return Returns true if successful + */ + public final static boolean delete(String filename) { + return new File(filename).delete(); + } + + /** + * + * @param toname + * @return Returns true if successful + */ + public final boolean renameFile(String toname) { + return f.renameTo(new File(toname)); + } + + /** + * Opens a buffered file for read + * + * @return Returns null if failed + */ + public final BufferedReader openBufferedRead() { + + try { + br = new BufferedReader(new FileReader(f)); + return br; + } catch (FileNotFoundException ex) { + } + return null; + } + + /** + * Use this if you need access to a file within a jar + * + */ + public final void openBufferedResource() { + + try { + String path = f.getPath(); + path = path.replace('\\', '/'); + InputStream is = getClass().getResourceAsStream(path); + br = new BufferedReader(new InputStreamReader(is)); + } catch (Exception ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "openBufferedRead(int filehandle)", "", ex); + } + } + + /** + * Opens a buffered file for append + * + */ + public final void openBufferedAppend() { + + try { + bw = new BufferedWriter(new FileWriter(f, true)); + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "openBufferedAppend()", "", ex); + } + } + + /** + * Read a single line from a text file + * + * @return Contents as String + */ + public final String readLine() { + try { + return br.readLine(); + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "readLine(int filehandle)", "", ex); + } + return null; + } + + /** + * Read bytes from previously opened BufferedReader + * + * @return Returns the entire contents from a file + */ + public final String readEntireFile() { + + char[] cb = new char[blockreadsize]; + StringBuilder sb = new StringBuilder(); + int bytes; + try { + while (br.ready()) { + bytes = br.read(cb); + sb.append(cb, 0, bytes); + } + return sb.toString(); + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "readEntireFile()", "", ex); + } + return ""; + } + + public final FileInputStream openFileInputStream(String filename) { + try { + return new FileInputStream(new File(filename)); + } catch (FileNotFoundException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "openFileInputStream()", "", ex); + return null; + } + } + + /** + * Opens a file output stream + * + * @return Returns Opened file output stream + */ + public final FileOutputStream openFileOutputStream() { + try { + return new FileOutputStream(f); + } catch (FileNotFoundException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "openFileOutputStream()", "", ex); + return null; + } + } + + /** + * Opens a buffered file for write + * + */ + public final void openBufferedWrite() { + + try { + bw = new BufferedWriter(new FileWriter(f)); + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "openBufferedWrite()", "", ex); + } + } + + public final void flushWriter() { + try { + bw.flush(); + } catch (IOException ex) { + } + } + + /** + * Write to a previously opened output file + * + * @param data The data to be written + * @param newlines The number of newlines to generate + */ + public final void writeFile(String data, int newlines) { + + try { + bw.write(data); + while (newlines > 0) { + bw.newLine(); + newlines--; + } + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), + "writeToFile(" + data + "," + String.valueOf(newlines) + ")", "", ex); + } + } + + /** + * Write to a previously opened output file + * + * @param data The character data to be written + * @param nochars + */ + public final void writeFile(char[] data, int nochars) { + + try { + bw.write(data, 0, nochars); + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "writeToFile()", "", ex); + } + } + + /** + * Copy file to + * + * @param frompath + * @param topath + */ + public final static void copyFromTo(String frompath, String topath) { + try { + Path source = new File(frompath).toPath(); + Path dest = new File(topath).toPath(); + Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING); + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, "SimpleFile", "copyFromTo()", "", ex); + } + } + + public final static void mergeFiles(String srcpath1, String srcpath2, String destpath) { + try (OutputStream os = new FileOutputStream(new File(destpath))) { + Path source = new File(srcpath1).toPath(); + Files.copy(source, os); + source = new File(srcpath2).toPath(); + Files.copy(source, os); + os.close(); + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, "SimpleFile", "mergeFiles", "", ex); + } + } + + /** + * Get the age of a specified file + * + * @param filepath + * @param period + * @return Age of file as float + */ + public final static float getAgeOfFile(String filepath, int period) { + File fx = new File(filepath); + if (!fx.exists()) { + return -1; + } + float fltAge = System.currentTimeMillis() - fx.lastModified(); + switch (period) { + case PERIOD_MINUTES: + return fltAge / 60000; + case PERIOD_HOURS: + return fltAge / (60000 * 60); + case PERIOD_DAYS: + return fltAge / (60000 * 60 * 24); + } + return -1; + } + + /** + * Test to see our file is older in minutes, returns true if it is + * + * @param filename + * @param minutes + * @return boolean + */ + public final static boolean isMinutesOlder(String filename, long minutes) { + long lngAge = System.currentTimeMillis() - new File(filename).lastModified(); + return lngAge > (60000 * minutes); + } + + /** + * Test to see our file is older in hours, returns true if it is + * + * @param filename + * @param hours + * @return boolean + */ + public final static boolean isHoursOlder(String filename, long hours) { + long lngAge = System.currentTimeMillis() - new File(filename).lastModified(); + return lngAge > (60000 * 60 * hours); + } + + /** + * Test to see our file is older in days, returns true if it is + * + * @param filename + * @param days + * @return boolean + */ + public final static boolean isDaysOlder(String filename, long days) { + long lngAge = System.currentTimeMillis() - new File(filename).lastModified(); + return lngAge > (60000 * 60 * 24 * days); + } + + /** + * Opens a zipstream. returns false if it fails + * + * @param level + * @return an open zipstream + */ + public final boolean openZipStream(int level) { + try { + zos = new ZipOutputStream(new FileOutputStream(f.getAbsolutePath())); + if (level < 0 || level > 9) { + level = 6; + } + zos.setLevel(level); + return true; + } catch (FileNotFoundException ex) { + } + return false; + } + + /** + * Close a zip stream + */ + public final void closeZipStream() { + if (zos != null) { + try { + zos.close(); + } catch (IOException ex) { + } + } + } + + public final static void compress(String source, String dest) { + final Path pathSource = Paths.get(source); + try { + final ZipOutputStream outputStream = new ZipOutputStream(new FileOutputStream(dest)); + Files.walkFileTree(pathSource, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) { + try { + Path targetFile = pathSource.relativize(file); + outputStream.putNextEntry(new ZipEntry(targetFile.toString())); + byte[] bytes = Files.readAllBytes(file); + outputStream.write(bytes, 0, bytes.length); + outputStream.closeEntry(); + } catch (IOException e) { + } + return FileVisitResult.CONTINUE; + } + }); + outputStream.close(); + } catch (IOException e) { + } + } + + /** + * Add files to a zip file + * + * @param srcfiles An array of Files + * @return boolean True if successful + */ + public final boolean addFilesToZip(File... srcfiles) { + FileInputStream in = null; + if (srcfiles == null || srcfiles.length == 0) { + return false; + } + try { + for (File fx : srcfiles) { + in = new FileInputStream(fx); + // name the file inside the zip file + zos.putNextEntry(new ZipEntry(fx.getName())); + byte[] b = Files.readAllBytes(Paths.get(fx.getAbsolutePath())); + zos.write(b, 0, b.length); + in.close(); + } + return true; + } catch (IOException ex) { + } finally { + try { + if (in != null) { + in.close(); + } + } catch (IOException ex) { + } + } + return false; + } + + /** + * Extracts a zip file to a supplied location + * + * @param destpath Destination for contents of zip file + * @return True if successful + */ + public final boolean extractZipTo(String destpath) { + FileOutputStream fos; + final int BUFFER = 2048; + try { + FileInputStream fis = new FileInputStream(f); + try (ZipInputStream zin = new ZipInputStream(new BufferedInputStream(fis))) { + ZipEntry entry; + while ((entry = zin.getNextEntry()) != null) { + int count; + byte data[] = new byte[BUFFER]; + try { + fos = new FileOutputStream(destpath + File.separator + entry.getName()); + } catch (FileNotFoundException ex) { + continue; + } + try (BufferedOutputStream dest = new BufferedOutputStream(fos, 2048)) { + while ((count = zin.read(data, 0, BUFFER)) != -1) { + dest.write(data, 0, count); + } + dest.flush(); + dest.close(); + } + fos.close(); + } + zin.close(); + fis.close(); + } + return true; + } catch (IOException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "extractZipTo()", "", ex); + } + return false; + } + + public final static boolean objectWrite(String filepath, Object o) { + ObjectOutputStream oos = null; + try { + oos = new ObjectOutputStream(new FileOutputStream(new File(filepath))); + } catch (FileNotFoundException ex) { + } catch (IOException ex) { + } + if (oos == null) { + return false; + } + try { + oos.writeObject(o); + oos.close(); + return true; + } catch (IOException ex) { + } + return false; + } + + public final static Object objectRead(String filepath, Object defObject) { + ObjectInputStream oos = null; + try { + oos = new ObjectInputStream(new FileInputStream(new File(filepath))); + } catch (FileNotFoundException ex) { + } catch (IOException ex) { + } + if (oos == null) { + return defObject; + } + Object result = defObject; + try { + result = oos.readObject(); + } catch (IOException | ClassNotFoundException ex) { + } + return result; + } + +} diff --git a/src/lib/SimpleProps.java b/src/lib/SimpleProps.java new file mode 100644 index 0000000..9c43a2f --- /dev/null +++ b/src/lib/SimpleProps.java @@ -0,0 +1,289 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Properties; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author Alistair Neil + */ +public final class SimpleProps { + + private final File fileStore; + private final String comment; + private final ArrayList alChanged; + private boolean boolDefaultEnabled; + private final Properties defProps = new Properties(); + private Properties appProps; + + /** + * Constructor, requires + * + * @param filepath + * @param comment + */ + public SimpleProps(String filepath, String comment) { + alChanged = new ArrayList<>(); + fileStore = new File(filepath); + this.comment = comment; + } + + /** + * Enable/disable default mode + * + * @param enabled + */ + public void setDefaultModeEnabled(boolean enabled) { + boolDefaultEnabled = enabled; + } + + /** + * Set a long number property + * + * @param property + * @param num + */ + public void setLong(String property, long num) { + String value = String.valueOf(num); + setString(property, value); + } + + /** + * Get a long number property + * + * @param property + * @return A long number + */ + public long getLong(String property) { + try { + if (boolDefaultEnabled) { + return Long.parseLong(defProps.getProperty(property)); + } else { + return Long.parseLong(appProps.getProperty(property)); + } + } catch (NumberFormatException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "getLong", "", ex); + return -1; + } + } + + /** + * Set a integer number property + * + * @param property + * @param num + */ + public void setInt(String property, int num) { + String value = String.valueOf(num); + setString(property, value); + } + + /** + * Get an integer number property + * + * @param property + * @return an integer + */ + public int getInt(String property) { + try { + if (boolDefaultEnabled) { + return Integer.parseInt(defProps.getProperty(property)); + } else { + return Integer.parseInt(appProps.getProperty(property)); + } + } catch (NumberFormatException ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "getInt", "", ex); + return -1; + } + } + + /** + * Set a boolean property + * + * @param property + * @param enabled + */ + public void setBool(String property, boolean enabled) { + if (enabled) { + setString(property, "true"); + } else { + setString(property, "false"); + } + } + + /** + * Get a boolean property + * + * @param property + * @return boolean + */ + public boolean getBool(String property) { + try { + String result; + if (boolDefaultEnabled) { + result = defProps.getProperty(property).toLowerCase(); + } else { + result = appProps.getProperty(property).toLowerCase(); + } + return result.contentEquals("true"); + } catch (Exception ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "getBool", "", ex); + return false; + } + } + + /** + * Set a String property + * + * @param key + * @param value + * @return String + */ + public Object setString(String key, String value) { + value = value.trim(); + if (boolDefaultEnabled) { + return defProps.setProperty(key, value); + } + String prop = appProps.getProperty(key); + if (prop == null) { + prop = "null"; + } + if (prop.contentEquals(value)) { + if (alChanged.contains(key)) { + alChanged.remove(key); + } + } else { + if (!alChanged.contains(key)) { + alChanged.add(key); + } + } + return appProps.setProperty(key, value); + } + + /** + * Get a String property + * + * @param key + * @return String or null + */ + public String getString(String key) { + try { + String prop; + if (boolDefaultEnabled) { + prop = defProps.getProperty(key); + } else { + prop = appProps.getProperty(key); + } + if (prop == null) { + prop = ""; + } + return prop; + } catch (Exception ex) { + Logger.getGlobal().logp(Level.WARNING, this.getClass().getName(), "getString", "", ex); + return null; + } + } + + /** + * Save to xml file + */ + public void save() { + alChanged.clear(); + OutputStream os = null; + try { + os = new FileOutputStream(fileStore); + appProps.storeToXML(os, comment); + } catch (Exception ex) { + Logger.getLogger(SimpleProps.class.getName()).log(Level.SEVERE, null, ex); + } finally { + try { + if (os != null) { + os.close(); + } + } catch (Exception ex) { + + } + } + } + + /** + * Load from xml file + */ + public void load() { + InputStream is = null; + try { + if (!fileStore.exists()) { + fileStore.getParentFile().mkdirs(); + fileStore.createNewFile(); + save(); + } + is = new FileInputStream(fileStore); + appProps.loadFromXML(is); + } catch (IOException ex) { + Logger.getLogger(SimpleProps.class.getName()).log(Level.SEVERE, null, ex); + } finally { + try { + if (is != null) { + is.close(); + } + } catch (Exception ex) { + } + } + alChanged.clear(); + } + + /** + * Delete the properties file store + * + * @return true if successful + */ + public boolean delete() { + if (fileStore.exists()) { + return fileStore.delete(); + } + return false; + } + + /** + * Get a comma separated list of properties that were changed + * + * @return A String of property keys that were changed + */ + public String getChangedProperties() { + return alChanged.toString(); + } + + /** + * Reset to defaults + */ + public void resetToDefaults() { + appProps = new Properties(defProps); + alChanged.clear(); + } + +} diff --git a/src/lib/SwingTrayIcon.java b/src/lib/SwingTrayIcon.java new file mode 100644 index 0000000..96d1649 --- /dev/null +++ b/src/lib/SwingTrayIcon.java @@ -0,0 +1,502 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.awt.AWTEvent; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.GraphicsConfiguration; +import java.awt.Insets; +import java.awt.MouseInfo; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.SystemTray; +import java.awt.Toolkit; +import java.awt.TrayIcon; +import java.awt.Window.Type; +import java.awt.event.AWTEventListener; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.regex.Pattern; +import javax.swing.BorderFactory; +import javax.swing.JDialog; +import javax.swing.JTextArea; +import javax.swing.JToolTip; +import javax.swing.JWindow; +import javax.swing.UIManager; +import javax.swing.event.PopupMenuEvent; +import javax.swing.event.PopupMenuListener; + +/** + * + * @author Alistair Neil + */ +public final class SwingTrayIcon { + + private InfoTip infoToolTip; + private JDialog jdiagPopup; + private TrayPopupMenu trayPopupMenu; + private AWTEventListener awtEventListen; + private volatile boolean mouseExited = false; + private SystemTray st = null; + private GraphicsConfiguration gc = null; + private Point mouseloc; + private TrayIcon ti; + private boolean loaded; + + public SwingTrayIcon(GraphicsConfiguration gc, String resourcepath) { + loaded = false; + if (!SystemTray.isSupported()) { + return; + } + try { + st = SystemTray.getSystemTray(); + ClassLoader cl = this.getClass().getClassLoader(); + ti = new TrayIcon(new javax.swing.ImageIcon(cl.getResource(resourcepath)).getImage()); + } catch (Exception ex) { + return; + } + ti.setImageAutoSize(true); + this.gc = gc; + initDiagPopup(); + if (OSFunction.isLinux()) { + infoToolTip = new InfoTip(); + infoToolTip.setFocusable(false); + } + initMouseHandler(); + } + + private void initMouseHandler() { + // We need a global mouse listener due to the way TrayIcon intercepts + // mousemovements but doesnt feed all the events back to us + awtEventListen = new java.awt.event.AWTEventListener() { + @Override + public void eventDispatched(AWTEvent event) { + // Catch mouse event so we can easily get coords + final MouseEvent e = (MouseEvent) event; + if (!(e.getSource() instanceof TrayIcon)) { + return; + } + mouseloc = MouseInfo.getPointerInfo().getLocation(); + switch (e.getID()) { + case MouseEvent.MOUSE_ENTERED: + if (infoToolTip == null || trayPopupMenu.isVisible()) { + return; + } + mouseExited = false; + // Raise tooltip + Thread t = new Thread(new java.lang.Runnable() { + @Override + public void run() { + try { + Thread.sleep(1000); + } catch (InterruptedException ex) { + } + if (!trayPopupMenu.isVisible() && !mouseExited) { + infoToolTip.setLocation(getPlacementPosition(mouseloc, infoToolTip.getWidth(), infoToolTip.getHeight(), true)); + infoToolTip.setVisible(true); + } else { + infoToolTip.setVisible(false); + } + } + }); + t.start(); + break; + + case MouseEvent.MOUSE_EXITED: + mouseExited = true; + if (infoToolTip != null) { + infoToolTip.setVisible(false); + } + break; + + case MouseEvent.MOUSE_RELEASED: + if (e.getButton() == MouseEvent.BUTTON3) { + if (infoToolTip != null) { + infoToolTip.setVisible(false); + } + mouseExited = true; + raisePopupMenu(mouseloc); + } + break; + } + + } + }; + Toolkit.getDefaultToolkit().addAWTEventListener(awtEventListen, AWTEvent.MOUSE_EVENT_MASK); + } + + /** + * Initialise our hidden dialog which we use to grab focus so that the + * popumenu can be closed whenever we click on the desktop + */ + private void initDiagPopup() { + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + jdiagPopup = new JDialog(); + jdiagPopup.setUndecorated(true); + jdiagPopup.setMinimumSize(new Dimension(0, 0)); + jdiagPopup.setBounds(new Rectangle(0, 0)); + jdiagPopup.setType(Type.POPUP); + jdiagPopup.setFocusable(false); + jdiagPopup.setAutoRequestFocus(false); + try { + jdiagPopup.setLocation(new Point(screenSize.width, screenSize.height)); + jdiagPopup.setOpacity(0); + } catch (Exception ex) { + } + jdiagPopup.addComponentListener(new java.awt.event.ComponentListener() { + + @Override + public void componentResized(ComponentEvent e) { + } + + @Override + public void componentMoved(ComponentEvent e) { + } + + @Override + public void componentShown(ComponentEvent e) { + trayPopupMenu.setVisible(true); + } + + @Override + public void componentHidden(ComponentEvent e) { + } + }); + } + + public void dispose() { + // Remove from system tray + unload(); + // Cleanup assets that may prevent shutdown + if (ti != null) { + for (MouseListener ml : ti.getMouseListeners()) { + ti.removeMouseListener(ml); + } + } + if (awtEventListen != null) { + Toolkit.getDefaultToolkit().removeAWTEventListener(awtEventListen); + awtEventListen = null; + } + if (trayPopupMenu != null) { + for (PopupMenuListener pml : trayPopupMenu.getPopupMenuListeners()) { + trayPopupMenu.removePopupMenuListener(pml); + } + trayPopupMenu = null; + } + if (jdiagPopup != null) { + for (ComponentListener cl : jdiagPopup.getComponentListeners()) { + jdiagPopup.removeComponentListener(cl); + } + jdiagPopup.dispose(); + jdiagPopup = null; + } + if (infoToolTip != null) { + infoToolTip.dispose(); + infoToolTip = null; + } + st = null; + } + + public void disable() { + unload(); + st = null; + } + + /** + * Set tray right click popup + * + * @param tpm + */ + public void setTrayPopupMenu(TrayPopupMenu tpm) { + trayPopupMenu = tpm; + if (tpm == null || ti == null) { + return; + } + trayPopupMenu.setFocusable(false); + // Add popup menu listener to detect when it is hidden + trayPopupMenu.addPopupMenuListener(new javax.swing.event.PopupMenuListener() { + + @Override + public void popupMenuWillBecomeVisible(PopupMenuEvent e) { + } + + @Override + public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { + jdiagPopup.setVisible(false); + } + + @Override + public void popupMenuCanceled(PopupMenuEvent e) { + jdiagPopup.setVisible(false); + } + }); + trayPopupMenu.setEnabled(true); + trayPopupMenu.setInvoker(jdiagPopup); + } + + /** + * Open tray popup + * + */ + private void raisePopupMenu(Point mouseloc) { + if (trayPopupMenu != null) { + // Set onscreen location of trayPopup + Point p = getPlacementPosition(mouseloc, trayPopupMenu.getVisibleRect().width, trayPopupMenu.getHeight(), false); + trayPopupMenu.setLocation(p); + jdiagPopup.setVisible(true); + } + } + + /** + * Calculate onscreen placement position based on mouse pointer position + * + * @param boxwidth + * @param boxheight + * @param centre + * @return Point + */ + private Point getPlacementPosition(Point coords, int boxwidth, int boxheight, boolean istooltip) { + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + Insets screenInsets; + Point result = new Point(); + double x, y, limit; + int yoff = 0; + + if (OSFunction.isLinux()) { + screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(gc); + int i = screenInsets.bottom + screenInsets.left + screenInsets.right + + screenInsets.top; + // If all insets are zero then offset them all by 32, bit of a hack + // for desktops that allow intelligent hiding of tray panel + if (i == 0) { + screenInsets = new Insets(32, 32, 32, 32); + } + } else { + screenInsets = new Insets(0, 0, 0, 0); + } + + // Calculate X axis positioning + x = coords.x; + if (x > (screenSize.getWidth() / 2)) { + limit = screenSize.width - screenInsets.right; + if (x + boxwidth > limit) { + if (screenInsets.right == 0) { + x -= boxwidth; + } else { + x = limit - boxwidth; + } + } + } else { + limit = screenInsets.left; + if (x < limit) { + x = limit; + } + } + + // Calculate Y axis positioning + y = coords.y; + if (y > (screenSize.getHeight() / 2)) { + // Bottom + if (istooltip && screenInsets.bottom == 0) { + yoff = (int) ((ti.getSize().getHeight() + 1) / 2); + } + } else // Bottom + { + if (istooltip && screenInsets.top == 0) { + yoff = (int) ((ti.getSize().getHeight() + 1) / 2); + } + } + + if (screenInsets.top != 0 && y < screenInsets.top) { + y += (screenInsets.top - y); + } + limit = screenSize.height - screenInsets.bottom; + if (y + yoff + boxheight > limit) { + if (yoff > 0) { + y -= (boxheight + yoff); + } else if (screenInsets.bottom == 0) { + y -= (boxheight + yoff); + } else { + y = limit - boxheight; + } + } else { + y += yoff; + } + result.setLocation(x, y); + return result; + } + + /** + * Set info tip text + * + * @param text + */ + public void setInfoTip(String text) { + if (ti == null) { + return; + } + if (OSFunction.isLinux()) { + // Check to see if tay icon need reloaded + if (SystemTray.isSupported() && isLoaded() && st.getTrayIcons().length == 0) { + try { + st.add(ti); + } catch (Exception ex) { + } + } + // Update tooltip (Linux only) + if (infoToolTip != null) { + infoToolTip.setText(text); + if (infoToolTip.isVisible()) { + infoToolTip.setLocation(getPlacementPosition(mouseloc, infoToolTip.getWidth(), infoToolTip.getHeight(), true)); + } + } + } else { + // Update tooltip (Windows Only) + ti.setToolTip(text); + } + } + + /** + * Display desktop message (Windows only) + * + * @param title + * @param body + */ + public void displayMessage(String title, String body) { + if (ti != null) { + ti.displayMessage(title, body, TrayIcon.MessageType.INFO); + } + } + + /** + * Load tray icon + */ + public void load() { + // I know this looks odd but it is required for onscreen positioning + // of the tray popup to work + if (trayPopupMenu != null) { + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + trayPopupMenu.setLocation(screenSize.height, screenSize.width); + trayPopupMenu.setVisible(true); + trayPopupMenu.setVisible(false); + } + // Add this tray icon to system tray + try { + if (st != null) { + st.add(ti); + loaded = true; + } + } catch (Exception ex) { + loaded = false; + } + } + + /** + * Unload Tray icon + */ + public void unload() { + // Remove the tray icon from system tray + if (st != null) { + st.remove(ti); + } + loaded = false; + } + + /** + * Add a mouse listener + * + * @param ml + */ + public void addMouseListener(MouseListener ml) { + if (ti != null) { + ti.addMouseListener(ml); + } + } + + /** + * Is tray icon loaded + * + * @return ture if it is + */ + public boolean isLoaded() { + return loaded; + } + + public boolean isSupported() { + return st != null; + } + + /** + * Info tip object + */ + private static final class InfoTip extends JWindow { + + JTextArea jta; + Pattern p = Pattern.compile("\n"); + + public InfoTip() { + initInfoTip(); + } + + private void initInfoTip() { + setType(Type.POPUP); + jta = new JTextArea(); + add(jta); + JToolTip jtt = jta.createToolTip(); + jta.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY)); + jta.setBackground(new Color(jtt.getBackground().getRGB())); + jta.setForeground(new Color(jtt.getForeground().getRGB())); + setBackground(jta.getBackground()); + jta.setOpaque(true); + jta.setEditable(false); + jta.setLineWrap(true); + jta.setWrapStyleWord(true); + jta.setVisible(true); + setEnabled(true); + } + + /** + * Set info tip text + * + * @param text + */ + public void setText(String text) { + String[] strs = p.split(text); + String largest = ""; + int longest = 0; + int width; + for (String s : strs) { + width = jta.getFontMetrics(jta.getFont()).stringWidth(s); + if (width > longest) { + largest = s; + longest = width; + } + } + jta.setText(" " + text.replace("\n", "\n ")); + width = jta.getFontMetrics(jta.getFont()).stringWidth(largest + "XXX"); + int lineheight = jta.getFontMetrics(jta.getFont()).getHeight() + 1; + int boxheight = jta.getLineCount() * (lineheight); + setSize(width, boxheight); + } + + } + +} diff --git a/src/lib/TextResourceDialog.form b/src/lib/TextResourceDialog.form new file mode 100644 index 0000000..7e489b1 --- /dev/null +++ b/src/lib/TextResourceDialog.form @@ -0,0 +1,93 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/lib/TextResourceDialog.java b/src/lib/TextResourceDialog.java new file mode 100644 index 0000000..3b51dd4 --- /dev/null +++ b/src/lib/TextResourceDialog.java @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +/** + * + * @author Alistair Neil + */ +public class TextResourceDialog extends javax.swing.JDialog { + + private String strUrl; + + /** + * Creates new License Dialog + * + * @param parent + * @param modal + */ + public TextResourceDialog(java.awt.Frame parent, boolean modal) { + super(parent, modal); + initComponents(); + jTextArea.setCaretPosition(0); + jButtonLaunchURL.setVisible(false); + } + + /** + * Set the browser url for unnoficial translation + * + * @param url + */ + public void setButtonURL(String url) { + strUrl = url; + jButtonLaunchURL.setVisible(url != null); + } + + /** + * Get the license text + * + * @return Text + */ + public String getText() { + return jTextArea.getText(); + } + + /** + * Set the license text + * + * @param text + */ + public void setText(String text) { + jTextArea.setText(text); + jTextArea.setCaretPosition(0); + } + + /** + * Set the text on the Close button + * + * @param text + */ + public void setCloseButtonText(String text) { + jButtonClose.setText(text); + } + + /** + * Set the text on the Close button + * + * @param text + */ + public void setURLButtonText(String text) { + jButtonLaunchURL.setText(text); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + // //GEN-BEGIN:initComponents + private void initComponents() { + + jScrollPane1 = new javax.swing.JScrollPane(); + jTextArea = new javax.swing.JTextArea(); + jButtonClose = new javax.swing.JButton(); + jButtonLaunchURL = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setResizable(false); + + jTextArea.setEditable(false); + jTextArea.setColumns(40); + jTextArea.setLineWrap(true); + jTextArea.setRows(20); + jTextArea.setText("\n"); + jTextArea.setWrapStyleWord(true); + jScrollPane1.setViewportView(jTextArea); + + jButtonClose.setText("Close"); + jButtonClose.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonCloseActionPerformed(evt); + } + }); + + jButtonLaunchURL.setText("URL Desc"); + jButtonLaunchURL.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonLaunchURLActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1) + .addGroup(layout.createSequentialGroup() + .addComponent(jButtonLaunchURL) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButtonClose))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButtonClose) + .addComponent(jButtonLaunchURL)) + .addContainerGap()) + ); + + pack(); + }// //GEN-END:initComponents + + private void jButtonCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed + dispose(); + }//GEN-LAST:event_jButtonCloseActionPerformed + + private void jButtonLaunchURLActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLaunchURLActionPerformed + Utilities.openFileExternally(strUrl); + }//GEN-LAST:event_jButtonLaunchURLActionPerformed + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButtonClose; + private javax.swing.JButton jButtonLaunchURL; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextArea jTextArea; + // End of variables declaration//GEN-END:variables +} diff --git a/src/lib/TrayPopupMenu.java b/src/lib/TrayPopupMenu.java new file mode 100644 index 0000000..11600a3 --- /dev/null +++ b/src/lib/TrayPopupMenu.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.awt.Color; +import java.awt.Graphics; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.UIManager; + +/** + * + * @author Alistair Neil + */ +public class TrayPopupMenu extends JPopupMenu { + + private Color bg; + + public TrayPopupMenu() { + super(); + bg = super.getBackground(); + } + + @Override + public JMenuItem add(JMenuItem mi) { + mi.setForeground(new Color(UIManager.getColor("MenuItem.foreground").getRGB())); + super.add(mi); + return mi; + } + + @Override + public void setForeground(Color fg) { + super.setForeground(fg); + } + + @Override + public void setBackground(Color bg) { + super.setBackground(bg); + this.bg = bg; + } + + @Override + public void paintComponent(final Graphics g) { + g.setColor(new Color(bg.getRGB())); + g.fillRect(0, 0, getWidth(), getHeight()); + } + +} diff --git a/src/lib/Utilities.java b/src/lib/Utilities.java new file mode 100644 index 0000000..3262836 --- /dev/null +++ b/src/lib/Utilities.java @@ -0,0 +1,497 @@ +/* + * Copyright (C) 2009-2017 Alistair Neil + * + * 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 2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package lib; + +import java.awt.Desktop; +import java.awt.FontMetrics; +import java.awt.Frame; +import java.awt.event.WindowEvent; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.ArrayList; +import java.util.Formatter; +import java.util.Random; +import java.util.regex.Pattern; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JTable; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.filechooser.FileFilter; + +/** + * + * @author Alistair Neil + */ +public final class Utilities { + + /** + * Constructor + */ + public Utilities() { + } + + /** + * Covert list to csv + * + * @param al + * @return String of comma separated values + */ + public static String getListAsCSV(ArrayList al) { + return al.toString().replace("[", "").replace("]", "").replace(" ", ""); + } + + /** + * Preloads filechooser in background so it will open instantly when + * requested + */ + public static void preloadFileChooser() { + Thread t = new Thread(new java.lang.Runnable() { + + @Override + public void run() { + JFileChooser fileChooser = new JFileChooser(); + } + }); + t.start(); + } + + /** + * Opens java file chooser dialog, convenience method. Returns filepath if + * successful and null if not + * + * @param parent + * @param folder + * @param filter Extension filter + * @param mode Fileselection mode + * @return String Filepath + */ + public static String openFileChooser(Frame parent, String folder, FileFilter filter, int mode) { + JFileChooser fileChooser = new JFileChooser(); + fileChooser.setFileSelectionMode(mode); + fileChooser.setCurrentDirectory(new File(folder)); + if (filter != null) { + fileChooser.addChoosableFileFilter(filter); + } + int intReturn = fileChooser.showOpenDialog(parent); + if (intReturn == JFileChooser.APPROVE_OPTION) { + return fileChooser.getSelectedFile().getAbsolutePath(); + } else { + return null; + } + } + + /** + * Check for newer appversion + * + * @param localversion + * @param remoteversion + * @return True if newer + */ + public static boolean isNewerVersion(String localversion, String remoteversion) { + return convertBuildnumToFloat(remoteversion) > convertBuildnumToFloat(localversion); + } + + /** + * Convert an debian build number into a floating point number + * + * @param version + * @return Float version + */ + private static float convertBuildnumToFloat(String version) { + + float result; + Pattern p; + String[] parts; + try { + if (version.contains("-")) { + // Handling for old non-debian compatible version + p = Pattern.compile("-"); + parts = p.split(version); + } else { + // Handling for new debian compatible version + p = Pattern.compile("\\."); + parts = p.split(version); + parts[0] = parts[0] + "." + parts[1]; + parts[1] = parts[2]; + parts[2] = ""; + } + result = Float.parseFloat(parts[0]); + result += (Float.parseFloat(parts[1]) / 100000); + } catch (Exception ex) { + version = version.replaceAll("[^0-9.]", ""); + result = convertVersionToFloat(version); + } + return result; + } + + /** + * Convert a windows version number into a floating point number + * + * @param version + * @return Float version + */ + private static float convertVersionToFloat(String version) { + + int c; + float f; + version = version.toLowerCase(); + if (version.startsWith("v")) { + version = version.substring(1); + } + try { + c = version.charAt(version.length() - 1); + if (c > 96) { + version = version.substring(0, version.length() - 1); + Float fraction = (float) (c - 96) / 10000; + f = Float.parseFloat(version) + fraction; + } else { + f = Float.parseFloat(version); + } + } catch (Exception ex) { + f = 0; + } + return f; + } + + /** + * Open the desktop default file editor + * + * @param path Path to file + */ + public static void editFile(String path) { + if (OSFunction.isLinux()) { + OSFunction.launchProcess("xdg-open", path); + return; + } + if (OSFunction.isWindows()) { + OSFunction.launchProcess("notepad", path); + } + } + + /** + * Launch the desktops default file handling program + * + * @param strUrl + * @return Returns true if successful + */ + public static boolean openFileExternally(final String strUrl) { + String url = strUrl.replace("\\", "/"); + try { + if (OSFunction.isLinux()) { + OSFunction.launchProcess("xdg-open", url); + } else { + if (Desktop.isDesktopSupported()) { + Desktop deskSupport = Desktop.getDesktop(); + if (url.startsWith("http") || url.startsWith("ftp")) { + deskSupport.browse(new URI(url)); + } else { + deskSupport.open(new File(url)); + } + } + } + return true; + } catch (URISyntaxException | IOException ex) { + } + return false; + } + + /** + * Initialises the UI Look and Feel + * + * @param theme + */ + public static void loadUIStyle(String theme) { + + try { + if (theme == null) { + UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); + return; + } + + if (theme.contentEquals("Metal")) { + UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); + return; + } + + if (theme.contentEquals("Nimbus")) { + // Switch to Nimbus theme + UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); + return; + } + + if (theme.contentEquals("System")) { + try { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); + return; + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { + } + try { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); + return; + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { + } + } + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { + } + + // If everything else fails use default cross platform metal + try { + UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { + } + } + + /** + * Adjust specified column width based on the width of a test string + * + * @param table + * @param test + */ + public static void adjustTableColumnWidth(JTable table, String... test) { + FontMetrics ourFontMetrics = table.getFontMetrics(table.getFont()); + int col = 0; + for (String s : test) { + table.getColumn(table.getColumnName(col++)).setPreferredWidth(ourFontMetrics.stringWidth(s)); + } + } + + /** + * Generate secret key. + * + * @param length + * @return String key + */ + public static String generateSecretKey(int length) { + StringBuilder buffer = new StringBuilder(); + Random random = new Random(); + String chars = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int x; + try { + for (int i = 0; i < length; i++) { + x = random.nextInt(chars.length() - 1); + buffer.append(chars.substring(x, x + 1)); + } + } catch (Exception ex) { + } + return buffer.toString(); + } + + public static String getTorHashPassword(String secret) { + byte[] key = S2KRFC2440(secret); + return "16:" + byteToHex(key); + } + + /** + * Secret to key, Algorithm info taken from + * http://sunsite.icm.edu.pl/gnupg/rfc2440-3.html + * + * @param secret + * @return hashed key for the given secret + */ + public static byte[] S2KRFC2440(String secret) { + + // Create our message digest for SHA-1 + MessageDigest md; + try { + md = MessageDigest.getInstance("SHA-1"); + } catch (Exception ex) { + return null; + } + + // Create our random S2K salt, the 9th byte is loaded with the code count which + // determines the amount of octet hashing used. + // This salt is eventually combined with the secret to prevent dictionary attacks + int codecount = 32; + byte[] s2ksalt = new byte[9]; + SecureRandom sr = new SecureRandom(); + sr.nextBytes(s2ksalt); + s2ksalt[8] = (byte) codecount; + // The octet hashing count is defined by the following formula where EXPBIAS is 6 + int octethashcount = (16 + (codecount & 15)) << ((codecount >> 4) + 6); + + // Merge our S2K salt and partialsecret arrays together into one array to + // create the full secret key. + byte[] partialsecret; + try { + partialsecret = secret.getBytes("UTF-8"); + } catch (UnsupportedEncodingException ex) { + return null; + } + byte[] fullsecret = new byte[8 + partialsecret.length]; + System.arraycopy(s2ksalt, 0, fullsecret, 0, 8); + System.arraycopy(partialsecret, 0, fullsecret, 8, partialsecret.length); + // Do the hashing based on the hashcount + while (true) { + if (octethashcount < fullsecret.length) { + md.update(fullsecret, 0, octethashcount); + break; + } else { + md.update(fullsecret); + } + octethashcount -= fullsecret.length; + } + // Create our final key by merging s2kspecifier and digest result + byte[] ourkey = new byte[20 + 9]; + System.arraycopy(md.digest(), 0, ourkey, 9, 20); + System.arraycopy(s2ksalt, 0, ourkey, 0, 9); + return ourkey; + } + + /** + * Get SHAHash using given password string + * + * @param password + * @return SHAhash string + */ + public static String getSHAHash(String password) { + String sha1 = ""; + try { + MessageDigest crypt = MessageDigest.getInstance("SHA-1"); + crypt.reset(); + crypt.update(password.getBytes("UTF-8")); + sha1 = byteToHex(crypt.digest()); + } catch (NoSuchAlgorithmException | UnsupportedEncodingException e) { + } + return sha1; + } + + /** + * Convert byte to a hex string + * + * @param hash + * @return byte as a hex string + */ + private static String byteToHex(final byte[] hash) { + String result; + try (Formatter formatter = new Formatter()) { + for (byte b : hash) { + formatter.format("%02x", b); + } + result = formatter.toString(); + } + return result; + } + + /** + * Retrieve text from a resource text file + * + * @param resourcepath + * @return String text + */ + public static String getTextFromResource(String resourcepath) { + SimpleFile sf = new SimpleFile(resourcepath); + sf.openBufferedResource(); + String text = sf.readEntireFile(); + sf.closeFile(); + return text; + } + + /** + * Retrieve text from a text file + * + * @param filepath + * @return String text + */ + public static String getTextFromFile(String filepath) { + SimpleFile sf = new SimpleFile(filepath); + String text = ""; + if (sf.exists()) { + sf.openBufferedRead(); + text = sf.readEntireFile(); + sf.closeFile(); + } + return text; + } + + /** + * Calculate the sha1 checksum of a given file + * + * @param filepath + * @return Checksum as a hex string + */ + public static String getSha1Sum(String filepath) { + StringBuilder sb = new StringBuilder(""); + try { + MessageDigest md = MessageDigest.getInstance("SHA1"); + FileInputStream fis = new FileInputStream(filepath); + byte[] dataBytes = new byte[1024]; + int nread; + while ((nread = fis.read(dataBytes)) != -1) { + md.update(dataBytes, 0, nread); + } + byte[] mdbytes = md.digest(); + //convert the byte to hex format + for (int i = 0; i < mdbytes.length; i++) { + sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1)); + } + } catch (NoSuchAlgorithmException | IOException ex) { + } + return sb.toString(); + } + + /** + * Creates a hidden dummy window for registration to various docks/launchers + * Fixes the neverending launching indicator + */ + public static void registerWindow() { + final JFrame jf = new JFrame(); + + jf.addWindowListener(new java.awt.event.WindowListener() { + @Override + public void windowOpened(WindowEvent e) { + jf.dispose(); + } + + @Override + public void windowClosing(WindowEvent e) { + } + + @Override + public void windowClosed(WindowEvent e) { + } + + @Override + public void windowIconified(WindowEvent e) { + } + + @Override + public void windowDeiconified(WindowEvent e) { + } + + @Override + public void windowActivated(WindowEvent e) { + } + + @Override + public void windowDeactivated(WindowEvent e) { + } + }); + jf.setUndecorated(true); + jf.setBounds(0, 0, 0, 0); + jf.setVisible(true); + } + +} diff --git a/src/resources/MessagesBundle.properties b/src/resources/MessagesBundle.properties new file mode 100644 index 0000000..ce26cdc --- /dev/null +++ b/src/resources/MessagesBundle.properties @@ -0,0 +1,263 @@ +# English GB, Default language file +gpltransurl=https://www.gnu.org/licenses/translations.en.html +appdesc=$appname $appver, Tor Exit Nodes Made Simple. +text_yes=Yes +text_no=No +text_mode=Mode +wintitle_prefs = $appname Preferences +wintitle_about = About $appname +wintitle_patternedit = $appname Pattern Editor +wintitle_guardnodes=Guard node selection +wintitle_tormonitor=Tor Client Monitor +textfield_unknown=Unknown +progstatus_initial=Initialising... +progstatus_generate=Generating fresh node list, please wait. +progstatus_cachedated=Cached descriptors out of date, will renew them. +progstatus_nonet=Internet access un-available. +progstatus_checkrecommended=Checking for the latest recommended nodes. +progstatus_gotrecommended=Retrieved recommended node list. +progstatus_torfailretry=Tor failed to start, retrying. +progstatus_nodefail=Requested node activation failed. +progstatus_nodefailretry=Requested node activation failed, will try again please wait. +progstatus_nodefailtorchoose=Requested node not reachable, will let Tor choose please wait. +progstatus_nodeactive3hop=3 Hop Circuit to exit node $nodename is active. +progstatus_nodeactive2hop=2 Hop Circuit to exit node $nodename is active. +progstatus_autoswitch=Auto-Switching to node +progstatus_manswitch=Switching to manually selected node +progstatus_waitfortor=Waiting for Tor to activate a node. +progstatus_switchtonode=Switching to node $nodename. +progstatus_applychanges=Applying new preferences. +circuit_status_creating_2hop=Creating 2 hop circuit. +circuit_status_creating_3hop=Creating 3 hop circuit. +circuit_status_testing=Testing circuit. +circuit_status_aborted=Testing aborted. +circuit_status_built=$1 circuits built. +circuit_status_passed=Circuit passed. +circuit_status_failed=Circuit Failed. +circuit_status_none=No circuits available. +circuit_status_noroute=All routers down. +combo_proxymode1=Disabled +combo_proxymode2=Proxy by Pattern +combo_proxymode3=Proxy all Traffic +combo_loglev1=Debug +combo_loglev2=Info +combo_loglev3=Notice +traymenu_proxymode1=Mode : Proxy Disabled +traymenu_proxymode2=Mode : Proxy by Pattern +traymenu_proxymode3=Mode : Proxy all Traffic +traymenu_showgui=Hide/Show GUI +traytool_guardnode=GuardNode +traytool_exitnode=ExitNode +exittable_col1=ExitNode +exittable_col2=BW (MB\\s) +exittable_col3=Latency (ms) +exittable_col4=Status +exittable_col5=Favourite +guardtable_col1=GuardNode +guardtable_col2=Country +guardtable_col3=BW (MB\\s) +guardtable_col4=Trusted +patterntable_col1=Description +patterntable_col2=Pattern +patterntable_col3=Enabled +menu_menu=Menu +menu_prefs=Preferences +menu_quickadd=Quick Add Pattern +menu_patternedit=Proxy Pattern Editor +menu_export=Export Patterns +menu_import=Import Patterns +menu_quit=Quit +menu_defaultpatterns=Default Patterns +menu_userpatterns=User Patterns +menu_help=Help +menu_debuglog=View Debug Log +menu_helpcontents=Help Contents +menu_torcheck=Tor Routing Check +menu_about=About +menu_license=License +menu_tormanual=Official Tor Manual +menu_tormonitor=Tor Client Monitor +menu_close=Close Menu +menu_proxy=Proxy Mode +menu_leaktest=DNS Leak Test +menu_credits=Credits +label_latency_url=Tor Latency Checking URL : +label_guardnode=Guard : +label_bridgenode=Bridge : +label_activecountry=Exit Country : +label_proxymode=Proxy Mode : +label_exitnode=Exit Node: +label_torlatency=Latency +label_fingerprint=Fingerprint: +label_bandwidth=Bandwidth +label_streams=Streams +label_stable=Stable +label_status=Client Status: +label_listenport=Tor Listening Port : +label_defaultproxy=Default HTTP Proxy : +label_bridgeaddress=Tor Bridge Address : +label_portranges=Currently active port ranges, $portmin to $portmax +label_editcountry=Select Country To View its Patterns +label_quickadd_desc=Description : +label_quickadd_pattern=Pattern : +label_threshold=Threshold +label_exitip=Exit IP: +label_guardip=Guard IP: +label_guardcountry=Guard Country: +label_torlogging=Logging Level : +label_torargs=Startup Arguments : +label_torsocks=Socks Settings : +label_diskoptions=Disk Options : +label_guard_minimum=You can have either zero guard nodes selected in which case the tor client will choose or you can have 3 or more guard nodes selected. +label_nickname=Nickname +label_ip=IP +label_country=Country +label_exit=Exit : +label_middle=Middle : +label_donotproxy=Do not proxy : +button_details=Atlas Details +button_whois=WhoIs +button_close=Close +button_apply=Apply +button_delete=Delete +button_addnew=Add New +button_save=Save +button_cancel=Cancel +button_continue=Continue +button_getbridges=Get Bridges +button_mozillarestart=$browser Restart +button_visitus=Visit Us +button_contactus=Contact Us +button_translations=Unofficial Translations +button_prefdefaults=Reset to Defaults +button_setguards=Set Guard Nodes +button_clearfavs=Clear Favourites +button_clearguards=Clear Selected Guards +button_support=Support SelekTOR +button_patreon=Support SelekTOR with Patreon +panel_info=Active Circuit +panel_general=General Settings +panel_network=Network Settings +panel_management=Node Management Settings +panel_torclientset=Tor Client Settings +panel_startupargs=Startup Arguments +panel_stdout=StdOut Monitor +chkbox_autoselect=Auto Node Select +chkbox_autostart=Autostart SelekTOR +chkbox_checkforupdates=Check for updates on startup +chkbox_disabletray=Disable tray icon. +chkbox_autopatterns=Auto install latest patterns. +chkbox_mozillawarn=Disable Mozilla warning +chkbox_recnodesonly=Use recommended nodes in Pattern Mode +chkbox_hidetotray=Minimise at startup +chkbox_minonclose=Minimise instead of Exit on close +chkbox_twohop=Use 2 hop circuits to Exit Node in Pattern mode +chkbox_safesocks=Safe Socks +chkbox_warnunsafesocks=Warn Unsafe +chkbox_diskavoid=Avoid disk writes +chkbox_testsocks=Test Socks +chkbox_safelog=Safe Logging +chkbox_guardwarn1=Issue popup warning if unspecified guard node is used +chkbox_securedelete=Secure delete Tor caches on exit +chkbox_guardwarn2=Issue popup warning if less than 3 guard nodes selected +ttip_autostart=Will start SelekTOR automatically on boot/login. +ttip_hidetotray=SelekTOR will startup in system tray +ttip_checkforupdates=SelekTOR will check for a newer version on startup +ttip_autoinstall=Will fetch the latest patterns from Dazzleships.Net. +ttip_disabletray=Disable the system tray icon +ttip_mozillawarn=Disable the Mozilla browser warning +ttip_listenport=The Tor client listening port. +ttip_defaultproxy=Any traffic not routed through Tor will be redirected through this HTTP proxy. +ttip_donotproxy=Any URL that contains one of these comma separated entries will not be proxied and will be connected to directly. +ttip_bridgeaddress=To bypass ISP blocking add a valid bridge address here. +ttip_forcedns=Force DNS Lookup via Tor, requires browser restart. +ttip_forcenode=When checked node will be activated regardless of any current activity +ttip_enhanon=Will use 3 node hops instead of 2 hops. +ttip_recnodesonly=Will use the recommended nodes in pattern mode +ttip_minonclose=Application will minimise instead of exit when main window is closed +ttip_threshold=Threshold Latency +ttip_safesocks=When enabled, Tor will reject application connections that use unsafe variants of the socks protocol. +ttip_warnunsafe=When enabled, Tor will warn whenever a request is received that only contains an IP address instead of a hostname. +ttip_testsocks=When enabled, Tor will make a notice-level log entry for each connection indicating whether it used a safe socks protocol or an unsafe one. +ttip_safelogging=When enabled, Tor will scrub potentially sensitive strings from log messages. +ttip_avoiddisk=When enabled, Tor will try to write to disk less frequently than we would otherwise. +ttip_extraargs=Additional user specified arguments, see Tor Manual. +ttip_combo_loglevel=Tor logging level. +ttip_twohop=Use 2 hop circuits instead of Tor default of 3, reduces latency but lowers anonymity. +ttip_resetbasicprefs=Reset Basic preferences to their defaults. +ttip_resetadvprefs=Reset Advanced preferences to their defaults. +ttip_securedelete=When enabled, Tor caches will be overwritten by zero's then deleted +ttip_autonode=When enabled, SelekTOR will attempt to choose the best performing node +ttip_guardwarn=When enabled, a popup warning will be issued indicating an un-specified guard node is active. +ttip_clearguards=Clear selected guard nodes. +ttip_clearfavs=Clear Favourites +ttip_guardwarn2=When enabled, a popup warning will be issued indicating not enough guardnodes are selected. +dlg_update_title=Update Available. +dlg_update_body=$version is now available for download. +dlg_restoreproxy_title=Original Proxy Settings +dlg_restoreproxy_body=Select Continue to restore the proxy settings to their original settings prior to the installation of SelekTOR. +dlg_resetproxy_title=Default Proxy Settings +dlg_resetproxy_body=Select Continue to reset proxy settings to their system defaults. +dlg_gsetting_title=Gsettings not found +dlg_gsetting_body=$appname cannot function fully without the gsettings binary installed, on some distro's it can be found in the package libglib2.0-bin. +dlg_torclient_title=TOR Client not found +dlg_torclient_body=$appname cannot function without the Tor client installed please install the tor and the tor-geoipdb packages for your distro. +dlg_mozillarestart_title=Warning: $browser browser is active. +dlg_mozillarestart_body=$appname detected that the $browser browser is already running.\nA browser restart is required to enable $appname functionality.\n\nIf you elect to restart $browser all currently open tabs will be restored when $browser restarts, requires \"Show my Windows and tabs from last time\" option to be selected in $browser preferences/options.\n\nYou can disable this browser warning in $appname Preferences. +dlg_license_title=$appname License +dlg_credits_title=$appname Credits +dlg_credits_body=To have your name listed here and also earn my gratitude please consider supporting the further development of SelekTOR on the Linux platform via Patreon. +dlg_exportuser_title=Export User Patterns +dlg_exportuser_body=No user created patterns found.\n\nUse the pattern editor to add your own patterns +dlg_exportdefault_title=Export Default Patterns +dlg_exportdefault_body=No default patterns found. +dlg_saveuser_title=Save User patterns +dlg_savedefault_title=Save Default patterns +dlg_import_title=Import pattern file +dlg_import_success_title=Patterns Imported +dlg_import_success_body=Patterns were succesfully imported and are now active. +dlg_import_fail_title=Import Failed +dlg_import_fail_body=Failed to correctly import patterns. +dlg_whois_title=Whois $ipaddress +dlg_whois_body=Please wait while I try fetching Whois data... +dlg_whois_fail=Sorry unable to fetch Whois information. +dlg_toold_body=The currently installed Tor client is to old, Tor 0.2.7.6 or better is required.\n\nLinux users should visit the following page\nhttps://www.torproject.org/download/download-unix.html.en\nto obtain the latest Tor client. +dlg_error_title=Startup Error +dlg_error_body=This error is fatal and $appname will shut itself down. +dlg_quickadd_title=Add Pattern +dlg_nodelistfail_body=Nodelist generation failed due to GEOIP errors. +dlg_patterneditsave_title=Save Current Patterns +dlg_patterneditsave_body=Current patterns have been modified.\n\nIf you wish to save them, click Continue else click Cancel. +dlg_instancefail_title=Multiple instance failure +dlg_instancefail_body=An instance of $appname is already running, only one instance can be run at any time.\n\nEither shutdown the existing instance of $appname or in the event of a $appname crash restart X by logging out and in again. +dlg_guardwarn_title=Guard Node Warning +dlg_guardwarn_body=A guard node that is not in your specified guard nodes list has been used.\nThis is probably due to your selected guard nodes being no longer reachable and thus the tor client has assigned its own guard node.\n\nYou may want to check your currently set guard nodes to see if they are still available or select new ones. +dlg_notenoughguards_body=Their are not enough guard nodes set for Tor to operate efficiently or securely.\n\nEither clear all selected guards which will allow the Tor client to choose its own guards or select three or more guards manually. +dlg_bridgerr_title=Bridge address validation failure +dlg_bridgerr_body=The supplied bridge information contains validation errors and does not conform to a valid host:port ipv4 address format.\n\nBridge specification format examples are as follows:\n\nSingle bridge:\n127.0.0.1:8080\n\nMultiple bridges:\n127.0.0.1:8080,128.5.6.8:224\n\nBridges have been reset to their defaults. +table_popup_details=Details +table_popup_begintest=Begin Test Cycle +table_popup_whois=WhoIs +tab_basic=Basic +tab_advanced=Advanced +isoA1=Anonymous Proxy +isoA2=Satellite Provider +isoO1=Other Country +isoU1=Unknown +chkbox_disablenotify=Disable desktop notifications +ttip_disablenotify=Disable desktop notifications +dlg_libnotify_title=notify-send not found +dlg_libnotify_body=Desktop notifications will not function without the libnotify-bin package installed.\n\nTo prevent this popup appearing again either install the required package or disable desktop notifications in preferences. +ttip_hidemin=Application will hide instead of minimise +chkbox_hidemin=Hide instead of Minimise +label_autoselect=Auto Selection Mode : +menu_geoip=Update GEOIP +chkbox_geocheck=Do quarterly GEOIP update check +ttip_geocheck=SelekTOR will popup the "GEOIP Update dialog" if your GEOIP database is out of date. +dlg_geo_title=GEO Location Data Update +dlg_geo_body=The default geo-location data that comes with the Tor client is sometimes out of date, You can have SelekTOR download and use the latest geolocation data. These are maintained on a quarterly basis.\n\nPlease note, if you choose not to update, some nodes may be assigned to the wrong country.\n\nThe data in these files, like the data supplied by the Tor client, is provided by Maxmind.com. +dload_status_contact=Fetching latest GEOIP data +dload_status_failed=Download failed +chkbox_viator=Download via Tor +ttip_patterntable=Supports in-line editing, double left click a table cell to begin editing. +fileext_pattern=Zipped Pattern File diff --git a/src/resources/MessagesBundle_en_US.properties b/src/resources/MessagesBundle_en_US.properties new file mode 100644 index 0000000..4e7db94 --- /dev/null +++ b/src/resources/MessagesBundle_en_US.properties @@ -0,0 +1,10 @@ +progstatus_initial=Initializing... +chkbox_hidetotray=Minimize at startup +chkbox_minonclose=Minimize instead of Exit on close +ttip_minonclose=Application will minimize instead of exit when window is closed. +ttip_hidemin=Application will hide instead of minimize +chkbox_hidemin=Hide instead of Minimize +button_clearfavs=Clear Favorites +ttip_clearfavs=Clear Favorites +exittable_col5=Favorite + diff --git a/src/resources/MessagesBundle_fr_CA.properties b/src/resources/MessagesBundle_fr_CA.properties new file mode 100644 index 0000000..777dff6 --- /dev/null +++ b/src/resources/MessagesBundle_fr_CA.properties @@ -0,0 +1,256 @@ +# French CA, Default language file, provided by yahoe001 +gpltransurl=https://fsffrance.org/gpl/gpl-fr.fr.html +appdesc=$appname $appver, Les n\u0153uds de sortie de Tor simplifi\u00e9s. +text_yes=Oui +text_no=Non +wintitle_prefs = Pr\u00e9f\u00e9rences de $appname +wintitle_about = \u00c0 propos de $appname +wintitle_patternedit = \u00c9diteur de mod\u00e8les $appname +wintitle_guardnodes=S\u00e9lection des n\u0153uds de garde +wintitle_tormonitor=Moniteur du client Tor +textfield_unknown=Inconnu +progstatus_initial=Initialisation... +progstatus_bridges=Mise en place du changement de ponts. +progstatus_generate=G\u00e9n\u00e9ration d'une nouvelle liste de n\u0153uds, veuillez patienter. +progstatus_cachedated=Les descripteurs en cache sont p\u00e9rim\u00e9s, ils seront renouvel\u00e9s. +progstatus_nonet=L'acc\u00e8s \u00e0 Internet n'est pas disponible. +progstatus_checkrecommended=Recherche des derniers n\u0153uds recommand\u00e9s. +progstatus_torfailretry=\u00c9chec lors du d\u00e9marrage de Tor, nouvel essai. +progstatus_nodefail=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. +progstatus_nodefailretry=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. Nouvel essai, veuillez patienter. +progstatus_nodefailtorchoose=Le n\u0153ud demand\u00e9 n'est pas joignable, Tor en choisira un, veuillez patienter. +progstatus_nodeactive3hop=Le circuit \u00e0 3 sauts vers le n\u0153ud de sortie $nodename est actif. +progstatus_nodeactive2hop=Le circuit \u00e0 2 sauts vers le n\u0153ud de sortie $nodename est actif. +progstatus_autoswitch=Auto-commutation vers le n\u0153ud +progstatus_manswitch=Commutation vers le n\u0153ud choisi manuellement +progstatus_waitfortor=Attente d'activation d'un n\u0153ud par Tor. +progstatus_switchtonode=Commutation vers le n\u0153ud $nodename. +progstatus_applychanges=Mise en place des nouvelles pr\u00e9f\u00e9rences. +circuit_status_creating_2hop=Cr\u00e9ation d'un circuit \u00e0 2 sauts. +circuit_status_creating_3hop=Cr\u00e9ation d'un circuit \u00e0 3 sauts. +circuit_status_testing=Test du circuit. +circuit_status_aborted=Test interrompu. +circuit_status_built=$1 circuit(s) construit(s). +circuit_status_passed=Circuit v\u00e9rifi\u00e9. +circuit_status_failed=\u00c9chec de circuit. +circuit_status_none=Aucun circuit n'est disponible. +circuit_status_noroute=Routeurs (tous) hors service. +combo_proxymode1=D\u00e9sactiv\u00e9 +combo_proxymode2=Relais par mod\u00e8le +combo_proxymode3=Relayer tout le trafic +combo_loglev1=D\u00e9bogage +combo_loglev2=Infos +combo_loglev3=Avis +traymenu_proxymode1=Mode : pas de relais +traymenu_proxymode2=Mode : relais par mod\u00e8le +traymenu_proxymode3=Mode : relayer tout le trafic +traymenu_showgui=Cacher/Montrer l'IUG +traytool_guardnode=Noeud de garde +traytool_exitnode=Noeud de sortie +exittable_col1=N\u0153ud de sortie +exittable_col2=BP (MB\\s) +exittable_col3=D\u00e9lai (ms) +exittable_col4=\u00c9tat +exittable_col5=Favori +patterntable_col1=Description +patterntable_col2=Mod\u00e8le +patterntable_col3=Activ\u00e9 +guardtable_col1=N\u0153ud de garde +guardtable_col2=Pays +guardtable_col3=BP (MB\\s) +guardtable_col4=De confiance +menu_menu=Menu +menu_prefs=Pr\u00e9f\u00e9rences +menu_quickadd=Ajout rapide d'un mod\u00e8le +menu_patternedit=\u00c9diteur de mod\u00e8les de relais +menu_export=Exporter les mod\u00e8les +menu_import=Import les mod\u00e8les +menu_quit=Quitter +menu_defaultpatterns=Mod\u00e8le par d\u00e9faut +menu_userpatterns=Mod\u00e8les de l'utilisateur +menu_help=Aide +menu_debuglog=Voir le journal de d\u00e9bogage +menu_helpcontents=Contenu de l'aide +menu_torcheck=V\u00e9rification de routine de Tor +menu_about=\u00c0 propos de +menu_license=Licence +menu_proxy=Mode de relais +menu_close=Fermer le menu +menu_tormanual=Manuel officiel de Tor +menu_tormonitor=Moniteur du client Tor +menu_leaktest=Test de fuite DNS +menu_credits=Cr\u00e9dits +label_activecountry=Pays actif : +label_proxymode=Mode de relais : +label_exitnode=N\u0153ud de sortie : +label_ip=IP : +label_torlatency=D\u00e9lai +label_fingerprint=Empreinte : +label_bandwidth=Bande passante +label_streams=Flux +label_stable=Stable +label_status=\u00c9tat : +label_listenport=Port d'\u00e9coute de Tor : +label_defaultproxy=Mandataire HTTP par d\u00e9faut : +label_bridgeaddress=Adresse de pont de Tor : +label_portranges=Plages de port pr\u00e9sentement actives, de $portmin \u00e0 $portmax +label_editcountry=Choisir un pays pour voir ses mod\u00e8les +label_quickadd_desc=Description : +label_quickadd_pattern=Mod\u00e8le : +label_threshold=D\u00e9lai seuil +label_middle=Milieu : +label_exit=Sortie : +label_nickname=Pseudonyme +label_ip=IP +label_country=Pays +label_guard_minimum=Vous pouvez soit ne choisir aucun n\u0153ud de garde au cas o\u00f9 le client Tor les choisit, soit choisir trois n\u0153uds de garde ou plus. +label_torlogging=Niveau de journalisation : +label_torargs=Arguments de d\u00e9marrage : +label_torsocks=Param\u00e8tres Socks : +label_diskoptions=Options du disque : +label_guardnode=Garde : +label_bridgenode=Pont : +label_donotproxy=Ne pas relayer : +button_details=D\u00e9tails +button_whois=Qui est +button_close=Fermer +button_apply=Appliquer +button_delete=Supprimer +button_addnew=Ajouter un nouveau +button_save=Enregistrer +button_cancel=Annuler +button_continue=Continuer +button_getbridges=Obtenir des ponts +button_mozillarestart=Red\u00e9marrer $browser +button_visitus=Rendez-nous visite +button_contactus=Contactez-nous +button_translations=Traductions non officielles +button_prefdefaults=R\u00e9initialiser aux leurs valeurs par d\u00e9faut. +button_setguards=D\u00e9finir les n\u0153uds de garde +button_details=D\u00e9tails de l'atlas +button_clearguards=Effacer les n\u0153uds de garde choisis +button_clearfavs=Effacer les favoris +button_support=Soutenir SelekTOR +button_patreon=Soutenir SelekTOR avec Patreon +panel_general=Param\u00e8tres g\u00e9n\u00e9raux +panel_network= Param\u00e8tres r\u00e9seau +panel_management=Param\u00e8tres de gestion des n\u0153uds +panel_info=Circuit actif +panel_torclientset=Param\u00e8tres du client Tor +panel_startupargs=Arguments de d\u00e9marrage +panel_stdout=Moniteur de sortie standard +chkbox_autoselect=Choix automatique du n\u0153ud +chkbox_autostart=D\u00e9marrage automatique de SelekTOR +chkbox_checkforupdates=V\u00e9rifier les mises \u00e0 jour au d\u00e9marrage +chkbox_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification +chkbox_autopatterns=Installer automatiquement les derniers mod\u00e8les. +chkbox_mozillawarn=D\u00e9sactiver l'avertissement de Mozilla +chkbox_recnodesonly=Utiliser les n\u0153uds recommand\u00e9s en mode par mod\u00e8les +chkbox_hidetotray=Minimiser au d\u00e9marrage +chkbox_minonclose=Minimiser plut\u00f4t que de quitter lors de la fermeture +chkbox_safesocks=Socks s\u00e9curitaire +chkbox_twohop=Utiliser des circuits \u00e0 2 sauts vers le n\u0153ud de sortie en mode par mod\u00e8les +chkbox_warnunsafesocks=Avertir si \u00e0 risque +chkbox_diskavoid=\u00c9viter les \u00e9critures sur le disque +chkbox_testsocks=Tester Socks +chkbox_safelog=Journalisation s\u00e9curitaire +chkbox_guardwarn1=Afficher une fen\u00eatre d'avertissement si un n\u0153ud de garde non sp\u00e9cifi\u00e9 est utilis\u00e9 +chkbox_guardwarn2=Afficher une fen\u00eatre d'avertissement si moins de trois n\u0153uds de garde sont choisis +chkbox_securedelete=Effacement s\u00e9curis\u00e9 des caches de Tor lors de la fermeture +ttip_autostart=D\u00e9marrage automatique de SelekTOR lors du d\u00e9marrage/de la connexion +ttip_hidetotray=Minimiser au d\u00e9marrage +ttip_checkforupdates=SelekTOR v\u00e9rifiera les mises \u00e0 jour au d\u00e9marage +ttip_autoinstall=Les derniers mod\u00e8les seront r\u00e9cup\u00e9r\u00e9s de Dazzleships.Net +ttip_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification +ttip_mozillawarn=D\u00e9sactiver l'avertissement du navigateur Mozilla +ttip_listenport=Le port d'\u00e9coute du client Tor +ttip_defaultproxy=Tout trafic qui ne sera pas redirig\u00e9 par Tor sera redirig\u00e9 par ce mandataire HTTP +ttip_donotproxy=Toute URL contenant une de ces entr\u00e9es s\u00e9par\u00e9es par des virgules ne sera pas relay\u00e9e. L'on s'y connectera directement. +ttip_bridgeaddress=Pour contourner le blocage du FSI, ajouter une adresse de pont valide ici +ttip_forcedns=Forcer la recherche DNS par Tor, exige le red\u00e9marrage du navigateur +ttip_forcenode=Si coch\u00e9, le n\u0153ud sera activ\u00e9 quelque soit l'activit\u00e9 du n\u0153ud +ttip_recnodesonly=Les n\u0153uds recommand\u00e9s seront utilis\u00e9s en mode par mod\u00e8les +ttip_minonclose=L'application sera minimis\u00e9e au lieu de quitter \u00e0 la fermeture de la fermeture principale +ttip_threshold=D\u00e9lai seuil +ttip_safesocks=Activ\u00e9e, Tor rejettera les connexions logicielles qui utilisent des variantes dangereuses du protocole Socks. +ttip_warnunsafe=Activ\u00e9e, Tor avertira \u00e0 chaque fois qu'une requ\u00eate est re\u00e7ue contenant seulement une adresse IP au lieu d'un nom d'h\u00f4te. +ttip_testsocks=Activ\u00e9e Tor journalisera une entr\u00e9e de journal de niveau avis pour chaque connexion en indiquant si elle utilise un protocole Socks s\u00e9curitaire ou dangereux. +ttip_safelogging=Activ\u00e9e, Tor nettoiera les cha\u00eenes potentiellement sensibles des messages de journalisation. +ttip_avoiddisk=Activ\u00e9e, Tor essaiera d'\u00e9crire moins fr\u00e9quemment sur le disque que nous ne le ferions autrement. +ttip_extraargs= Arguments suppl\u00e9mentaires sp\u00e9cifi\u00e9s par l'utilisateur, voir le Manuel Tor. +ttip_combo_loglevel=Niveau de journalisation de Tor. +ttip_twohop=Utiliser des circuits \u00e0 2 sauts au lieu des 3 par d\u00e9faut de Tor. R\u00e9duit le d\u00e9lai de transit mais affaiblit l'anonymat. +ttip_resetbasicprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences de base \u00e0 leurs valeurs par d\u00e9faut. +ttip_resetadvprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences avanc\u00e9es \u00e0 leurs valeurs par d\u00e9faut. +ttip_guardwarn1=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant qu'un n\u0153ud de garde non sp\u00e9cifi\u00e9 est actif. +ttip_guardwarn2=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant que trop peu de n\u0153uds de garde sont choisis +ttip_clearguards=Effacer les n\u0153uds de garde choisis. +ttip_securedelete=Activ\u00e9, les caches de Tor seront \u00e9cras\u00e9es par des z\u00e9ros, puis supprim\u00e9es +dlg_update_title=Mise \u00e0 jour disponible. +dlg_update_body=$version est maintenant disponible au t\u00e9l\u00e9chargement. +dlg_restoreproxy_title=Param\u00e8tres originaux du mandataire +dlg_restoreproxy_body=Choisir Continuer pour restaurer les param\u00e8tres du mandataire aux valeurs par d\u00e9faut avant l'installation de SelekTOR. +dlg_resetproxy_title=Param\u00e8tres par d\u00e9faut du mandataire +dlg_resetproxy_body=Choisir Continuer pour r\u00e9initialiser les param\u00e8tres du serveur mandataire \u00e0 leurs valeurs syst\u00e8me par d\u00e9faut. +dlg_gsetting_title=Gsettings introuvable +dlg_gsetting_body=$appname ne peux pas fonctionner correctement sans que l'ex\u00e9cutable binary soit install\u00e9. Dans certaines distributions il peut \u00eatre trouv\u00e9 dans le paquet libglib2.0-bin. +dlg_torclient_title=Client TOR introuvable +dlg_torclient_body=$appname ne peux pas fonctionner sans que le client Tor ne soit Install\u00e9. Veuillez installer les paquets tor et tor-geoipdb pour votre distribution. +dlg_mozillarestart_title=Avertissement\u00a0: Le navigateur $browser est actif. +dlg_mozillarestart_body=$appname a d\u00e9tect\u00e9 que le navigateur $browser tourne d\u00e9j\u00e0.\nUn red\u00e9marrage du navigateur est exig\u00e9 pour permettre le fonctionnement de $appname.\n\nSi vous choisissez de red\u00e9marrer $browser, tous les onglets actuellement ouverts seront restaur\u00e9s au red\u00e9marrage de $browser, l'option \u00ab Afficher les dernier onglets et fen\u00eatres utilis\u00e9s \u00bb, doit \u00eatre choisie dans les options de $browser.\n\nVous pouvez d\u00e9sactiver cet avertissement du navigateur dans les Pr\u00e9f\u00e9rences de $appname. +dlg_license_title=Licence de $appname +dlg_exportuser_title=Exporter les mod\u00e8les d'utilisateur +dlg_exportuser_body=Aucun mod\u00e8le cr\u00e9\u00e9 par l'utilisateur n'a \u00e9t\u00e9 trouv\u00e9.\n\nUtilisez l'\u00e9diteur de mode pour ajouter vos propres mod\u00e8les +dlg_exportdefault_title=Exporter les mod\u00e8les par d\u00e9faut +dlg_exportdefault_body=Aucun mod\u00e8le par d\u00e9faut n'a \u00e9t\u00e9 trouv\u00e9. +dlg_saveuser_title=Enregistrer les modes de l'utilisateur +dlg_savedefault_title=Enregistrer les mod\u00e8les par d\u00e9faut +dlg_import_title=Importer le fichier des mod\u00e8les +dlg_import_success_title=Mod\u00e8les import\u00e9s +dlg_import_success_body=Les mod\u00e8les ont \u00e9t\u00e9 import\u00e9s avec succ\u00e8s et sont maintenant actifs. +dlg_import_fail_title=\u00c9chec lors l'importation +dlg_import_fail_body=Les mod\u00e8les n'ont pas \u00e9t\u00e9 import\u00e9s correctement. +dlg_whois_title=Qui est $ipaddress +dlg_whois_body=Veuillez patienter pendant que j'essaie de r\u00e9cup\u00e9rer les donn\u00e9s de WhoIs... +dlg_whois_fail=D\u00e9sol\u00e9, impossible de r\u00e9cup\u00e9rer les informations de Whois. +dlg_toold_body=Le client Tor actuellement install\u00e9 est trop ancien, Tor 0.2.7.6 ou ult\u00e9rieure est exig\u00e9e.\n\nLes utilisateurs de Linux devraient visiter la page suivante \nhttps://www.torproject.org/download/download-unix.html.en\npour obtenir le dernier client Tor. +dlg_error_title=Erreur de d\u00e9marrage +dlg_error_body=Cette erreur est fatale et $appname se fermera. +dlg_quickadd_title=Ajouter un mod\u00e8le +dlg_nodelistfail_body=La g\u00e9n\u00e9ration de la liste des n\u0153uds a \u00e9chou\u00e9 \u00e0 cause d'erreurs de GEOIP. +dlg_patterneditsave_title=Enregistrer les mod\u00e8les actuels +dlg_patterneditsave_body=Les mod\u00e8les actuels ont \u00e9t\u00e9 modifi\u00e9s.\n\nSi vous d\u00e9sirez les enregistrer, cliquez sur Continuer, autrement cliquez sur Annuler. +dlg_instancefail_title=\u00c9chec d\u00fb \u00e0 plusieurs instances +dlg_instancefail_body=Une instance de $appname est d\u00e9j\u00e0 en cours et une seule peut \u00eatre ex\u00e9cut\u00e9e \u00e0 la fois.\n\nQuittez l'instance existante de $appname ou dans le cas d'un plantage de $appname, red\u00e9marrez X en vous d\u00e9connectant et en vous connectant de nouveau. +dlg_guardwarn_title=Avertissement de n\u0153ud de garde +dlg_guardwarn_body=Un n\u0153ud de garde ne se trouvant pas dans votre liste de n\u0153uds de garde sp\u00e9cifi\u00e9e a \u00e9t\u00e9 utilis\u00e9.\nCeci provient probablement du fait que vos n\u0153uds de garde s\u00e9lectionn\u00e9s ne sont plus joignables et par cons\u00e9quent le client Tor a assign\u00e9 son propre n\u0153ud de garde.\n\nVous devriez v\u00e9rifier vos n\u0153uds de garde actuellement d\u00e9finis pour voir s'ils sont toujours disponibles, ou en choisir de nouveaux. +dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus.dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus. +dlg_bridgerr_title=\u00c9chec de validation de l'adresse de pont +dlg_bridgerr_body=Les informations de pont fournies contiennent des erreurs de validation et ne se conforment pas \u00e0 un format d'adresse IPv4 valide h\u00f4te:port\n\nVoici des exemples de format de sp\u00e9cification de ponts :\n\nPont simple : \n127.0.0.1:8080\n\nPonts multiples : \n127.0.0.1:8080,128.5.6.8:224\n\nLes ponts ont \u00e9t\u00e9 r\u00e9initialis\u00e9s \u00e0 leurs valeurs par d\u00e9faut. +dlg_credits_title=Cr\u00e9dits de $appname +dlg_credits_body=Afin que votre nom apparaissent ici et pour aussi m\u00e9riter ma gratitude, veuillez envisager de soutenir le d\u00e9veloppement futur de SelekTOR sous Linux avec Patreon. +table_popup_details=D\u00e9tails +table_popup_whois=Qui est +table_popup_begintest=Commencer le cycle de test +tab_basic=De base +tab_advanced=Avanc\u00e9 +isoA1=Mandataire annonyme +isoO1=autre Pays +isoU1=Inconnu +chkbox_disablenotify=D\u00e9sactiver les notifications du bureau +ttip_disablenotify=D\u00e9sactiver les notifications du bureau +dlg_libnotify_title=notify-send est introuvable +dlg_libnotify_body=Les notifications de bureau ne fonctionneront pas sans que le paquet libnotify-bin ne soit install\u00e9.\n\nPour emp\u00eacher que cette fen\u00eatre apparaissent de nouveau installez le paquet exig\u00e9 ou d\u00e9sactivez les notifications de bureau dans les pr\u00e9f\u00e9rences. +ttip_hidemin=L'appli sera cach\u00e9e au lieu d'\u00eatre minimis\u00e9e. +chkbox_hidemin=Cacher au lieu de minimiser +label_autoselect= Mode de s\u00e9lection automatique : +menu_geoip=Mettre GEOIP \u00e0 jour +chkbox_geocheck=V\u00e9rification trimestrielle des mises \u00e0 jour GEOIP +ttip_geocheck=SelekTOR affichera la \u00abfen\u00eatre de mise \u00e0 jour GEOIP \u00bbsi votre base de donn\u00e9es GEOIP est p\u00e9rim\u00e9e. +dlg_geo_title=Mise \u00e0 jour des donn\u00e9es de g\u00e9olocalisation +dlg_geo_body=Les donn\u00e9es de g\u00e9olocalisation fournies par Tor sont parfois p\u00e9rim\u00e9es. Vous pouvez demander \u00e0 SelekTOR de t\u00e9l\u00e9charger ses propres fichiers de donn\u00e9es de g\u00e9olocalisation de Dazzleships.net et de les utiliser. Ils sont mis \u00e0 jour trimestriellement.\n\nVeuillez noter que si vous choisissez de ne pas mettre \u00e0 jour, certains n\u0153uds pourraient \u00eatre assign\u00e9s au mauvais pays.\n\nLes donn\u00e9es des ces fichiers, comme les donn\u00e9es fournies par le client Tor, sont fournies par Maxmind.com. +dload_status_contact=R\u00e9cup\u00e9ration des derni\u00e8res donn\u00e9es GEOIP +dload_status_failed=\u00c9chec de t\u00e9l\u00e9chargement +chkbox_viator=T\u00e9l\u00e9charger par Tor +ttip_patterntable=\u00c9dition en ligne prise en charge, un double-clic gauche lance l'\u00e9dition d'une cellule d'un tableau. +fileext_pattern=Fichiers de mod\u00e8les zipp\u00e9 \ No newline at end of file diff --git a/src/resources/MessagesBundle_fr_CH.properties b/src/resources/MessagesBundle_fr_CH.properties new file mode 100644 index 0000000..777dff6 --- /dev/null +++ b/src/resources/MessagesBundle_fr_CH.properties @@ -0,0 +1,256 @@ +# French CA, Default language file, provided by yahoe001 +gpltransurl=https://fsffrance.org/gpl/gpl-fr.fr.html +appdesc=$appname $appver, Les n\u0153uds de sortie de Tor simplifi\u00e9s. +text_yes=Oui +text_no=Non +wintitle_prefs = Pr\u00e9f\u00e9rences de $appname +wintitle_about = \u00c0 propos de $appname +wintitle_patternedit = \u00c9diteur de mod\u00e8les $appname +wintitle_guardnodes=S\u00e9lection des n\u0153uds de garde +wintitle_tormonitor=Moniteur du client Tor +textfield_unknown=Inconnu +progstatus_initial=Initialisation... +progstatus_bridges=Mise en place du changement de ponts. +progstatus_generate=G\u00e9n\u00e9ration d'une nouvelle liste de n\u0153uds, veuillez patienter. +progstatus_cachedated=Les descripteurs en cache sont p\u00e9rim\u00e9s, ils seront renouvel\u00e9s. +progstatus_nonet=L'acc\u00e8s \u00e0 Internet n'est pas disponible. +progstatus_checkrecommended=Recherche des derniers n\u0153uds recommand\u00e9s. +progstatus_torfailretry=\u00c9chec lors du d\u00e9marrage de Tor, nouvel essai. +progstatus_nodefail=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. +progstatus_nodefailretry=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. Nouvel essai, veuillez patienter. +progstatus_nodefailtorchoose=Le n\u0153ud demand\u00e9 n'est pas joignable, Tor en choisira un, veuillez patienter. +progstatus_nodeactive3hop=Le circuit \u00e0 3 sauts vers le n\u0153ud de sortie $nodename est actif. +progstatus_nodeactive2hop=Le circuit \u00e0 2 sauts vers le n\u0153ud de sortie $nodename est actif. +progstatus_autoswitch=Auto-commutation vers le n\u0153ud +progstatus_manswitch=Commutation vers le n\u0153ud choisi manuellement +progstatus_waitfortor=Attente d'activation d'un n\u0153ud par Tor. +progstatus_switchtonode=Commutation vers le n\u0153ud $nodename. +progstatus_applychanges=Mise en place des nouvelles pr\u00e9f\u00e9rences. +circuit_status_creating_2hop=Cr\u00e9ation d'un circuit \u00e0 2 sauts. +circuit_status_creating_3hop=Cr\u00e9ation d'un circuit \u00e0 3 sauts. +circuit_status_testing=Test du circuit. +circuit_status_aborted=Test interrompu. +circuit_status_built=$1 circuit(s) construit(s). +circuit_status_passed=Circuit v\u00e9rifi\u00e9. +circuit_status_failed=\u00c9chec de circuit. +circuit_status_none=Aucun circuit n'est disponible. +circuit_status_noroute=Routeurs (tous) hors service. +combo_proxymode1=D\u00e9sactiv\u00e9 +combo_proxymode2=Relais par mod\u00e8le +combo_proxymode3=Relayer tout le trafic +combo_loglev1=D\u00e9bogage +combo_loglev2=Infos +combo_loglev3=Avis +traymenu_proxymode1=Mode : pas de relais +traymenu_proxymode2=Mode : relais par mod\u00e8le +traymenu_proxymode3=Mode : relayer tout le trafic +traymenu_showgui=Cacher/Montrer l'IUG +traytool_guardnode=Noeud de garde +traytool_exitnode=Noeud de sortie +exittable_col1=N\u0153ud de sortie +exittable_col2=BP (MB\\s) +exittable_col3=D\u00e9lai (ms) +exittable_col4=\u00c9tat +exittable_col5=Favori +patterntable_col1=Description +patterntable_col2=Mod\u00e8le +patterntable_col3=Activ\u00e9 +guardtable_col1=N\u0153ud de garde +guardtable_col2=Pays +guardtable_col3=BP (MB\\s) +guardtable_col4=De confiance +menu_menu=Menu +menu_prefs=Pr\u00e9f\u00e9rences +menu_quickadd=Ajout rapide d'un mod\u00e8le +menu_patternedit=\u00c9diteur de mod\u00e8les de relais +menu_export=Exporter les mod\u00e8les +menu_import=Import les mod\u00e8les +menu_quit=Quitter +menu_defaultpatterns=Mod\u00e8le par d\u00e9faut +menu_userpatterns=Mod\u00e8les de l'utilisateur +menu_help=Aide +menu_debuglog=Voir le journal de d\u00e9bogage +menu_helpcontents=Contenu de l'aide +menu_torcheck=V\u00e9rification de routine de Tor +menu_about=\u00c0 propos de +menu_license=Licence +menu_proxy=Mode de relais +menu_close=Fermer le menu +menu_tormanual=Manuel officiel de Tor +menu_tormonitor=Moniteur du client Tor +menu_leaktest=Test de fuite DNS +menu_credits=Cr\u00e9dits +label_activecountry=Pays actif : +label_proxymode=Mode de relais : +label_exitnode=N\u0153ud de sortie : +label_ip=IP : +label_torlatency=D\u00e9lai +label_fingerprint=Empreinte : +label_bandwidth=Bande passante +label_streams=Flux +label_stable=Stable +label_status=\u00c9tat : +label_listenport=Port d'\u00e9coute de Tor : +label_defaultproxy=Mandataire HTTP par d\u00e9faut : +label_bridgeaddress=Adresse de pont de Tor : +label_portranges=Plages de port pr\u00e9sentement actives, de $portmin \u00e0 $portmax +label_editcountry=Choisir un pays pour voir ses mod\u00e8les +label_quickadd_desc=Description : +label_quickadd_pattern=Mod\u00e8le : +label_threshold=D\u00e9lai seuil +label_middle=Milieu : +label_exit=Sortie : +label_nickname=Pseudonyme +label_ip=IP +label_country=Pays +label_guard_minimum=Vous pouvez soit ne choisir aucun n\u0153ud de garde au cas o\u00f9 le client Tor les choisit, soit choisir trois n\u0153uds de garde ou plus. +label_torlogging=Niveau de journalisation : +label_torargs=Arguments de d\u00e9marrage : +label_torsocks=Param\u00e8tres Socks : +label_diskoptions=Options du disque : +label_guardnode=Garde : +label_bridgenode=Pont : +label_donotproxy=Ne pas relayer : +button_details=D\u00e9tails +button_whois=Qui est +button_close=Fermer +button_apply=Appliquer +button_delete=Supprimer +button_addnew=Ajouter un nouveau +button_save=Enregistrer +button_cancel=Annuler +button_continue=Continuer +button_getbridges=Obtenir des ponts +button_mozillarestart=Red\u00e9marrer $browser +button_visitus=Rendez-nous visite +button_contactus=Contactez-nous +button_translations=Traductions non officielles +button_prefdefaults=R\u00e9initialiser aux leurs valeurs par d\u00e9faut. +button_setguards=D\u00e9finir les n\u0153uds de garde +button_details=D\u00e9tails de l'atlas +button_clearguards=Effacer les n\u0153uds de garde choisis +button_clearfavs=Effacer les favoris +button_support=Soutenir SelekTOR +button_patreon=Soutenir SelekTOR avec Patreon +panel_general=Param\u00e8tres g\u00e9n\u00e9raux +panel_network= Param\u00e8tres r\u00e9seau +panel_management=Param\u00e8tres de gestion des n\u0153uds +panel_info=Circuit actif +panel_torclientset=Param\u00e8tres du client Tor +panel_startupargs=Arguments de d\u00e9marrage +panel_stdout=Moniteur de sortie standard +chkbox_autoselect=Choix automatique du n\u0153ud +chkbox_autostart=D\u00e9marrage automatique de SelekTOR +chkbox_checkforupdates=V\u00e9rifier les mises \u00e0 jour au d\u00e9marrage +chkbox_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification +chkbox_autopatterns=Installer automatiquement les derniers mod\u00e8les. +chkbox_mozillawarn=D\u00e9sactiver l'avertissement de Mozilla +chkbox_recnodesonly=Utiliser les n\u0153uds recommand\u00e9s en mode par mod\u00e8les +chkbox_hidetotray=Minimiser au d\u00e9marrage +chkbox_minonclose=Minimiser plut\u00f4t que de quitter lors de la fermeture +chkbox_safesocks=Socks s\u00e9curitaire +chkbox_twohop=Utiliser des circuits \u00e0 2 sauts vers le n\u0153ud de sortie en mode par mod\u00e8les +chkbox_warnunsafesocks=Avertir si \u00e0 risque +chkbox_diskavoid=\u00c9viter les \u00e9critures sur le disque +chkbox_testsocks=Tester Socks +chkbox_safelog=Journalisation s\u00e9curitaire +chkbox_guardwarn1=Afficher une fen\u00eatre d'avertissement si un n\u0153ud de garde non sp\u00e9cifi\u00e9 est utilis\u00e9 +chkbox_guardwarn2=Afficher une fen\u00eatre d'avertissement si moins de trois n\u0153uds de garde sont choisis +chkbox_securedelete=Effacement s\u00e9curis\u00e9 des caches de Tor lors de la fermeture +ttip_autostart=D\u00e9marrage automatique de SelekTOR lors du d\u00e9marrage/de la connexion +ttip_hidetotray=Minimiser au d\u00e9marrage +ttip_checkforupdates=SelekTOR v\u00e9rifiera les mises \u00e0 jour au d\u00e9marage +ttip_autoinstall=Les derniers mod\u00e8les seront r\u00e9cup\u00e9r\u00e9s de Dazzleships.Net +ttip_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification +ttip_mozillawarn=D\u00e9sactiver l'avertissement du navigateur Mozilla +ttip_listenport=Le port d'\u00e9coute du client Tor +ttip_defaultproxy=Tout trafic qui ne sera pas redirig\u00e9 par Tor sera redirig\u00e9 par ce mandataire HTTP +ttip_donotproxy=Toute URL contenant une de ces entr\u00e9es s\u00e9par\u00e9es par des virgules ne sera pas relay\u00e9e. L'on s'y connectera directement. +ttip_bridgeaddress=Pour contourner le blocage du FSI, ajouter une adresse de pont valide ici +ttip_forcedns=Forcer la recherche DNS par Tor, exige le red\u00e9marrage du navigateur +ttip_forcenode=Si coch\u00e9, le n\u0153ud sera activ\u00e9 quelque soit l'activit\u00e9 du n\u0153ud +ttip_recnodesonly=Les n\u0153uds recommand\u00e9s seront utilis\u00e9s en mode par mod\u00e8les +ttip_minonclose=L'application sera minimis\u00e9e au lieu de quitter \u00e0 la fermeture de la fermeture principale +ttip_threshold=D\u00e9lai seuil +ttip_safesocks=Activ\u00e9e, Tor rejettera les connexions logicielles qui utilisent des variantes dangereuses du protocole Socks. +ttip_warnunsafe=Activ\u00e9e, Tor avertira \u00e0 chaque fois qu'une requ\u00eate est re\u00e7ue contenant seulement une adresse IP au lieu d'un nom d'h\u00f4te. +ttip_testsocks=Activ\u00e9e Tor journalisera une entr\u00e9e de journal de niveau avis pour chaque connexion en indiquant si elle utilise un protocole Socks s\u00e9curitaire ou dangereux. +ttip_safelogging=Activ\u00e9e, Tor nettoiera les cha\u00eenes potentiellement sensibles des messages de journalisation. +ttip_avoiddisk=Activ\u00e9e, Tor essaiera d'\u00e9crire moins fr\u00e9quemment sur le disque que nous ne le ferions autrement. +ttip_extraargs= Arguments suppl\u00e9mentaires sp\u00e9cifi\u00e9s par l'utilisateur, voir le Manuel Tor. +ttip_combo_loglevel=Niveau de journalisation de Tor. +ttip_twohop=Utiliser des circuits \u00e0 2 sauts au lieu des 3 par d\u00e9faut de Tor. R\u00e9duit le d\u00e9lai de transit mais affaiblit l'anonymat. +ttip_resetbasicprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences de base \u00e0 leurs valeurs par d\u00e9faut. +ttip_resetadvprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences avanc\u00e9es \u00e0 leurs valeurs par d\u00e9faut. +ttip_guardwarn1=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant qu'un n\u0153ud de garde non sp\u00e9cifi\u00e9 est actif. +ttip_guardwarn2=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant que trop peu de n\u0153uds de garde sont choisis +ttip_clearguards=Effacer les n\u0153uds de garde choisis. +ttip_securedelete=Activ\u00e9, les caches de Tor seront \u00e9cras\u00e9es par des z\u00e9ros, puis supprim\u00e9es +dlg_update_title=Mise \u00e0 jour disponible. +dlg_update_body=$version est maintenant disponible au t\u00e9l\u00e9chargement. +dlg_restoreproxy_title=Param\u00e8tres originaux du mandataire +dlg_restoreproxy_body=Choisir Continuer pour restaurer les param\u00e8tres du mandataire aux valeurs par d\u00e9faut avant l'installation de SelekTOR. +dlg_resetproxy_title=Param\u00e8tres par d\u00e9faut du mandataire +dlg_resetproxy_body=Choisir Continuer pour r\u00e9initialiser les param\u00e8tres du serveur mandataire \u00e0 leurs valeurs syst\u00e8me par d\u00e9faut. +dlg_gsetting_title=Gsettings introuvable +dlg_gsetting_body=$appname ne peux pas fonctionner correctement sans que l'ex\u00e9cutable binary soit install\u00e9. Dans certaines distributions il peut \u00eatre trouv\u00e9 dans le paquet libglib2.0-bin. +dlg_torclient_title=Client TOR introuvable +dlg_torclient_body=$appname ne peux pas fonctionner sans que le client Tor ne soit Install\u00e9. Veuillez installer les paquets tor et tor-geoipdb pour votre distribution. +dlg_mozillarestart_title=Avertissement\u00a0: Le navigateur $browser est actif. +dlg_mozillarestart_body=$appname a d\u00e9tect\u00e9 que le navigateur $browser tourne d\u00e9j\u00e0.\nUn red\u00e9marrage du navigateur est exig\u00e9 pour permettre le fonctionnement de $appname.\n\nSi vous choisissez de red\u00e9marrer $browser, tous les onglets actuellement ouverts seront restaur\u00e9s au red\u00e9marrage de $browser, l'option \u00ab Afficher les dernier onglets et fen\u00eatres utilis\u00e9s \u00bb, doit \u00eatre choisie dans les options de $browser.\n\nVous pouvez d\u00e9sactiver cet avertissement du navigateur dans les Pr\u00e9f\u00e9rences de $appname. +dlg_license_title=Licence de $appname +dlg_exportuser_title=Exporter les mod\u00e8les d'utilisateur +dlg_exportuser_body=Aucun mod\u00e8le cr\u00e9\u00e9 par l'utilisateur n'a \u00e9t\u00e9 trouv\u00e9.\n\nUtilisez l'\u00e9diteur de mode pour ajouter vos propres mod\u00e8les +dlg_exportdefault_title=Exporter les mod\u00e8les par d\u00e9faut +dlg_exportdefault_body=Aucun mod\u00e8le par d\u00e9faut n'a \u00e9t\u00e9 trouv\u00e9. +dlg_saveuser_title=Enregistrer les modes de l'utilisateur +dlg_savedefault_title=Enregistrer les mod\u00e8les par d\u00e9faut +dlg_import_title=Importer le fichier des mod\u00e8les +dlg_import_success_title=Mod\u00e8les import\u00e9s +dlg_import_success_body=Les mod\u00e8les ont \u00e9t\u00e9 import\u00e9s avec succ\u00e8s et sont maintenant actifs. +dlg_import_fail_title=\u00c9chec lors l'importation +dlg_import_fail_body=Les mod\u00e8les n'ont pas \u00e9t\u00e9 import\u00e9s correctement. +dlg_whois_title=Qui est $ipaddress +dlg_whois_body=Veuillez patienter pendant que j'essaie de r\u00e9cup\u00e9rer les donn\u00e9s de WhoIs... +dlg_whois_fail=D\u00e9sol\u00e9, impossible de r\u00e9cup\u00e9rer les informations de Whois. +dlg_toold_body=Le client Tor actuellement install\u00e9 est trop ancien, Tor 0.2.7.6 ou ult\u00e9rieure est exig\u00e9e.\n\nLes utilisateurs de Linux devraient visiter la page suivante \nhttps://www.torproject.org/download/download-unix.html.en\npour obtenir le dernier client Tor. +dlg_error_title=Erreur de d\u00e9marrage +dlg_error_body=Cette erreur est fatale et $appname se fermera. +dlg_quickadd_title=Ajouter un mod\u00e8le +dlg_nodelistfail_body=La g\u00e9n\u00e9ration de la liste des n\u0153uds a \u00e9chou\u00e9 \u00e0 cause d'erreurs de GEOIP. +dlg_patterneditsave_title=Enregistrer les mod\u00e8les actuels +dlg_patterneditsave_body=Les mod\u00e8les actuels ont \u00e9t\u00e9 modifi\u00e9s.\n\nSi vous d\u00e9sirez les enregistrer, cliquez sur Continuer, autrement cliquez sur Annuler. +dlg_instancefail_title=\u00c9chec d\u00fb \u00e0 plusieurs instances +dlg_instancefail_body=Une instance de $appname est d\u00e9j\u00e0 en cours et une seule peut \u00eatre ex\u00e9cut\u00e9e \u00e0 la fois.\n\nQuittez l'instance existante de $appname ou dans le cas d'un plantage de $appname, red\u00e9marrez X en vous d\u00e9connectant et en vous connectant de nouveau. +dlg_guardwarn_title=Avertissement de n\u0153ud de garde +dlg_guardwarn_body=Un n\u0153ud de garde ne se trouvant pas dans votre liste de n\u0153uds de garde sp\u00e9cifi\u00e9e a \u00e9t\u00e9 utilis\u00e9.\nCeci provient probablement du fait que vos n\u0153uds de garde s\u00e9lectionn\u00e9s ne sont plus joignables et par cons\u00e9quent le client Tor a assign\u00e9 son propre n\u0153ud de garde.\n\nVous devriez v\u00e9rifier vos n\u0153uds de garde actuellement d\u00e9finis pour voir s'ils sont toujours disponibles, ou en choisir de nouveaux. +dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus.dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus. +dlg_bridgerr_title=\u00c9chec de validation de l'adresse de pont +dlg_bridgerr_body=Les informations de pont fournies contiennent des erreurs de validation et ne se conforment pas \u00e0 un format d'adresse IPv4 valide h\u00f4te:port\n\nVoici des exemples de format de sp\u00e9cification de ponts :\n\nPont simple : \n127.0.0.1:8080\n\nPonts multiples : \n127.0.0.1:8080,128.5.6.8:224\n\nLes ponts ont \u00e9t\u00e9 r\u00e9initialis\u00e9s \u00e0 leurs valeurs par d\u00e9faut. +dlg_credits_title=Cr\u00e9dits de $appname +dlg_credits_body=Afin que votre nom apparaissent ici et pour aussi m\u00e9riter ma gratitude, veuillez envisager de soutenir le d\u00e9veloppement futur de SelekTOR sous Linux avec Patreon. +table_popup_details=D\u00e9tails +table_popup_whois=Qui est +table_popup_begintest=Commencer le cycle de test +tab_basic=De base +tab_advanced=Avanc\u00e9 +isoA1=Mandataire annonyme +isoO1=autre Pays +isoU1=Inconnu +chkbox_disablenotify=D\u00e9sactiver les notifications du bureau +ttip_disablenotify=D\u00e9sactiver les notifications du bureau +dlg_libnotify_title=notify-send est introuvable +dlg_libnotify_body=Les notifications de bureau ne fonctionneront pas sans que le paquet libnotify-bin ne soit install\u00e9.\n\nPour emp\u00eacher que cette fen\u00eatre apparaissent de nouveau installez le paquet exig\u00e9 ou d\u00e9sactivez les notifications de bureau dans les pr\u00e9f\u00e9rences. +ttip_hidemin=L'appli sera cach\u00e9e au lieu d'\u00eatre minimis\u00e9e. +chkbox_hidemin=Cacher au lieu de minimiser +label_autoselect= Mode de s\u00e9lection automatique : +menu_geoip=Mettre GEOIP \u00e0 jour +chkbox_geocheck=V\u00e9rification trimestrielle des mises \u00e0 jour GEOIP +ttip_geocheck=SelekTOR affichera la \u00abfen\u00eatre de mise \u00e0 jour GEOIP \u00bbsi votre base de donn\u00e9es GEOIP est p\u00e9rim\u00e9e. +dlg_geo_title=Mise \u00e0 jour des donn\u00e9es de g\u00e9olocalisation +dlg_geo_body=Les donn\u00e9es de g\u00e9olocalisation fournies par Tor sont parfois p\u00e9rim\u00e9es. Vous pouvez demander \u00e0 SelekTOR de t\u00e9l\u00e9charger ses propres fichiers de donn\u00e9es de g\u00e9olocalisation de Dazzleships.net et de les utiliser. Ils sont mis \u00e0 jour trimestriellement.\n\nVeuillez noter que si vous choisissez de ne pas mettre \u00e0 jour, certains n\u0153uds pourraient \u00eatre assign\u00e9s au mauvais pays.\n\nLes donn\u00e9es des ces fichiers, comme les donn\u00e9es fournies par le client Tor, sont fournies par Maxmind.com. +dload_status_contact=R\u00e9cup\u00e9ration des derni\u00e8res donn\u00e9es GEOIP +dload_status_failed=\u00c9chec de t\u00e9l\u00e9chargement +chkbox_viator=T\u00e9l\u00e9charger par Tor +ttip_patterntable=\u00c9dition en ligne prise en charge, un double-clic gauche lance l'\u00e9dition d'une cellule d'un tableau. +fileext_pattern=Fichiers de mod\u00e8les zipp\u00e9 \ No newline at end of file diff --git a/src/resources/MessagesBundle_fr_FR.properties b/src/resources/MessagesBundle_fr_FR.properties new file mode 100644 index 0000000..777dff6 --- /dev/null +++ b/src/resources/MessagesBundle_fr_FR.properties @@ -0,0 +1,256 @@ +# French CA, Default language file, provided by yahoe001 +gpltransurl=https://fsffrance.org/gpl/gpl-fr.fr.html +appdesc=$appname $appver, Les n\u0153uds de sortie de Tor simplifi\u00e9s. +text_yes=Oui +text_no=Non +wintitle_prefs = Pr\u00e9f\u00e9rences de $appname +wintitle_about = \u00c0 propos de $appname +wintitle_patternedit = \u00c9diteur de mod\u00e8les $appname +wintitle_guardnodes=S\u00e9lection des n\u0153uds de garde +wintitle_tormonitor=Moniteur du client Tor +textfield_unknown=Inconnu +progstatus_initial=Initialisation... +progstatus_bridges=Mise en place du changement de ponts. +progstatus_generate=G\u00e9n\u00e9ration d'une nouvelle liste de n\u0153uds, veuillez patienter. +progstatus_cachedated=Les descripteurs en cache sont p\u00e9rim\u00e9s, ils seront renouvel\u00e9s. +progstatus_nonet=L'acc\u00e8s \u00e0 Internet n'est pas disponible. +progstatus_checkrecommended=Recherche des derniers n\u0153uds recommand\u00e9s. +progstatus_torfailretry=\u00c9chec lors du d\u00e9marrage de Tor, nouvel essai. +progstatus_nodefail=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. +progstatus_nodefailretry=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. Nouvel essai, veuillez patienter. +progstatus_nodefailtorchoose=Le n\u0153ud demand\u00e9 n'est pas joignable, Tor en choisira un, veuillez patienter. +progstatus_nodeactive3hop=Le circuit \u00e0 3 sauts vers le n\u0153ud de sortie $nodename est actif. +progstatus_nodeactive2hop=Le circuit \u00e0 2 sauts vers le n\u0153ud de sortie $nodename est actif. +progstatus_autoswitch=Auto-commutation vers le n\u0153ud +progstatus_manswitch=Commutation vers le n\u0153ud choisi manuellement +progstatus_waitfortor=Attente d'activation d'un n\u0153ud par Tor. +progstatus_switchtonode=Commutation vers le n\u0153ud $nodename. +progstatus_applychanges=Mise en place des nouvelles pr\u00e9f\u00e9rences. +circuit_status_creating_2hop=Cr\u00e9ation d'un circuit \u00e0 2 sauts. +circuit_status_creating_3hop=Cr\u00e9ation d'un circuit \u00e0 3 sauts. +circuit_status_testing=Test du circuit. +circuit_status_aborted=Test interrompu. +circuit_status_built=$1 circuit(s) construit(s). +circuit_status_passed=Circuit v\u00e9rifi\u00e9. +circuit_status_failed=\u00c9chec de circuit. +circuit_status_none=Aucun circuit n'est disponible. +circuit_status_noroute=Routeurs (tous) hors service. +combo_proxymode1=D\u00e9sactiv\u00e9 +combo_proxymode2=Relais par mod\u00e8le +combo_proxymode3=Relayer tout le trafic +combo_loglev1=D\u00e9bogage +combo_loglev2=Infos +combo_loglev3=Avis +traymenu_proxymode1=Mode : pas de relais +traymenu_proxymode2=Mode : relais par mod\u00e8le +traymenu_proxymode3=Mode : relayer tout le trafic +traymenu_showgui=Cacher/Montrer l'IUG +traytool_guardnode=Noeud de garde +traytool_exitnode=Noeud de sortie +exittable_col1=N\u0153ud de sortie +exittable_col2=BP (MB\\s) +exittable_col3=D\u00e9lai (ms) +exittable_col4=\u00c9tat +exittable_col5=Favori +patterntable_col1=Description +patterntable_col2=Mod\u00e8le +patterntable_col3=Activ\u00e9 +guardtable_col1=N\u0153ud de garde +guardtable_col2=Pays +guardtable_col3=BP (MB\\s) +guardtable_col4=De confiance +menu_menu=Menu +menu_prefs=Pr\u00e9f\u00e9rences +menu_quickadd=Ajout rapide d'un mod\u00e8le +menu_patternedit=\u00c9diteur de mod\u00e8les de relais +menu_export=Exporter les mod\u00e8les +menu_import=Import les mod\u00e8les +menu_quit=Quitter +menu_defaultpatterns=Mod\u00e8le par d\u00e9faut +menu_userpatterns=Mod\u00e8les de l'utilisateur +menu_help=Aide +menu_debuglog=Voir le journal de d\u00e9bogage +menu_helpcontents=Contenu de l'aide +menu_torcheck=V\u00e9rification de routine de Tor +menu_about=\u00c0 propos de +menu_license=Licence +menu_proxy=Mode de relais +menu_close=Fermer le menu +menu_tormanual=Manuel officiel de Tor +menu_tormonitor=Moniteur du client Tor +menu_leaktest=Test de fuite DNS +menu_credits=Cr\u00e9dits +label_activecountry=Pays actif : +label_proxymode=Mode de relais : +label_exitnode=N\u0153ud de sortie : +label_ip=IP : +label_torlatency=D\u00e9lai +label_fingerprint=Empreinte : +label_bandwidth=Bande passante +label_streams=Flux +label_stable=Stable +label_status=\u00c9tat : +label_listenport=Port d'\u00e9coute de Tor : +label_defaultproxy=Mandataire HTTP par d\u00e9faut : +label_bridgeaddress=Adresse de pont de Tor : +label_portranges=Plages de port pr\u00e9sentement actives, de $portmin \u00e0 $portmax +label_editcountry=Choisir un pays pour voir ses mod\u00e8les +label_quickadd_desc=Description : +label_quickadd_pattern=Mod\u00e8le : +label_threshold=D\u00e9lai seuil +label_middle=Milieu : +label_exit=Sortie : +label_nickname=Pseudonyme +label_ip=IP +label_country=Pays +label_guard_minimum=Vous pouvez soit ne choisir aucun n\u0153ud de garde au cas o\u00f9 le client Tor les choisit, soit choisir trois n\u0153uds de garde ou plus. +label_torlogging=Niveau de journalisation : +label_torargs=Arguments de d\u00e9marrage : +label_torsocks=Param\u00e8tres Socks : +label_diskoptions=Options du disque : +label_guardnode=Garde : +label_bridgenode=Pont : +label_donotproxy=Ne pas relayer : +button_details=D\u00e9tails +button_whois=Qui est +button_close=Fermer +button_apply=Appliquer +button_delete=Supprimer +button_addnew=Ajouter un nouveau +button_save=Enregistrer +button_cancel=Annuler +button_continue=Continuer +button_getbridges=Obtenir des ponts +button_mozillarestart=Red\u00e9marrer $browser +button_visitus=Rendez-nous visite +button_contactus=Contactez-nous +button_translations=Traductions non officielles +button_prefdefaults=R\u00e9initialiser aux leurs valeurs par d\u00e9faut. +button_setguards=D\u00e9finir les n\u0153uds de garde +button_details=D\u00e9tails de l'atlas +button_clearguards=Effacer les n\u0153uds de garde choisis +button_clearfavs=Effacer les favoris +button_support=Soutenir SelekTOR +button_patreon=Soutenir SelekTOR avec Patreon +panel_general=Param\u00e8tres g\u00e9n\u00e9raux +panel_network= Param\u00e8tres r\u00e9seau +panel_management=Param\u00e8tres de gestion des n\u0153uds +panel_info=Circuit actif +panel_torclientset=Param\u00e8tres du client Tor +panel_startupargs=Arguments de d\u00e9marrage +panel_stdout=Moniteur de sortie standard +chkbox_autoselect=Choix automatique du n\u0153ud +chkbox_autostart=D\u00e9marrage automatique de SelekTOR +chkbox_checkforupdates=V\u00e9rifier les mises \u00e0 jour au d\u00e9marrage +chkbox_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification +chkbox_autopatterns=Installer automatiquement les derniers mod\u00e8les. +chkbox_mozillawarn=D\u00e9sactiver l'avertissement de Mozilla +chkbox_recnodesonly=Utiliser les n\u0153uds recommand\u00e9s en mode par mod\u00e8les +chkbox_hidetotray=Minimiser au d\u00e9marrage +chkbox_minonclose=Minimiser plut\u00f4t que de quitter lors de la fermeture +chkbox_safesocks=Socks s\u00e9curitaire +chkbox_twohop=Utiliser des circuits \u00e0 2 sauts vers le n\u0153ud de sortie en mode par mod\u00e8les +chkbox_warnunsafesocks=Avertir si \u00e0 risque +chkbox_diskavoid=\u00c9viter les \u00e9critures sur le disque +chkbox_testsocks=Tester Socks +chkbox_safelog=Journalisation s\u00e9curitaire +chkbox_guardwarn1=Afficher une fen\u00eatre d'avertissement si un n\u0153ud de garde non sp\u00e9cifi\u00e9 est utilis\u00e9 +chkbox_guardwarn2=Afficher une fen\u00eatre d'avertissement si moins de trois n\u0153uds de garde sont choisis +chkbox_securedelete=Effacement s\u00e9curis\u00e9 des caches de Tor lors de la fermeture +ttip_autostart=D\u00e9marrage automatique de SelekTOR lors du d\u00e9marrage/de la connexion +ttip_hidetotray=Minimiser au d\u00e9marrage +ttip_checkforupdates=SelekTOR v\u00e9rifiera les mises \u00e0 jour au d\u00e9marage +ttip_autoinstall=Les derniers mod\u00e8les seront r\u00e9cup\u00e9r\u00e9s de Dazzleships.Net +ttip_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification +ttip_mozillawarn=D\u00e9sactiver l'avertissement du navigateur Mozilla +ttip_listenport=Le port d'\u00e9coute du client Tor +ttip_defaultproxy=Tout trafic qui ne sera pas redirig\u00e9 par Tor sera redirig\u00e9 par ce mandataire HTTP +ttip_donotproxy=Toute URL contenant une de ces entr\u00e9es s\u00e9par\u00e9es par des virgules ne sera pas relay\u00e9e. L'on s'y connectera directement. +ttip_bridgeaddress=Pour contourner le blocage du FSI, ajouter une adresse de pont valide ici +ttip_forcedns=Forcer la recherche DNS par Tor, exige le red\u00e9marrage du navigateur +ttip_forcenode=Si coch\u00e9, le n\u0153ud sera activ\u00e9 quelque soit l'activit\u00e9 du n\u0153ud +ttip_recnodesonly=Les n\u0153uds recommand\u00e9s seront utilis\u00e9s en mode par mod\u00e8les +ttip_minonclose=L'application sera minimis\u00e9e au lieu de quitter \u00e0 la fermeture de la fermeture principale +ttip_threshold=D\u00e9lai seuil +ttip_safesocks=Activ\u00e9e, Tor rejettera les connexions logicielles qui utilisent des variantes dangereuses du protocole Socks. +ttip_warnunsafe=Activ\u00e9e, Tor avertira \u00e0 chaque fois qu'une requ\u00eate est re\u00e7ue contenant seulement une adresse IP au lieu d'un nom d'h\u00f4te. +ttip_testsocks=Activ\u00e9e Tor journalisera une entr\u00e9e de journal de niveau avis pour chaque connexion en indiquant si elle utilise un protocole Socks s\u00e9curitaire ou dangereux. +ttip_safelogging=Activ\u00e9e, Tor nettoiera les cha\u00eenes potentiellement sensibles des messages de journalisation. +ttip_avoiddisk=Activ\u00e9e, Tor essaiera d'\u00e9crire moins fr\u00e9quemment sur le disque que nous ne le ferions autrement. +ttip_extraargs= Arguments suppl\u00e9mentaires sp\u00e9cifi\u00e9s par l'utilisateur, voir le Manuel Tor. +ttip_combo_loglevel=Niveau de journalisation de Tor. +ttip_twohop=Utiliser des circuits \u00e0 2 sauts au lieu des 3 par d\u00e9faut de Tor. R\u00e9duit le d\u00e9lai de transit mais affaiblit l'anonymat. +ttip_resetbasicprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences de base \u00e0 leurs valeurs par d\u00e9faut. +ttip_resetadvprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences avanc\u00e9es \u00e0 leurs valeurs par d\u00e9faut. +ttip_guardwarn1=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant qu'un n\u0153ud de garde non sp\u00e9cifi\u00e9 est actif. +ttip_guardwarn2=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant que trop peu de n\u0153uds de garde sont choisis +ttip_clearguards=Effacer les n\u0153uds de garde choisis. +ttip_securedelete=Activ\u00e9, les caches de Tor seront \u00e9cras\u00e9es par des z\u00e9ros, puis supprim\u00e9es +dlg_update_title=Mise \u00e0 jour disponible. +dlg_update_body=$version est maintenant disponible au t\u00e9l\u00e9chargement. +dlg_restoreproxy_title=Param\u00e8tres originaux du mandataire +dlg_restoreproxy_body=Choisir Continuer pour restaurer les param\u00e8tres du mandataire aux valeurs par d\u00e9faut avant l'installation de SelekTOR. +dlg_resetproxy_title=Param\u00e8tres par d\u00e9faut du mandataire +dlg_resetproxy_body=Choisir Continuer pour r\u00e9initialiser les param\u00e8tres du serveur mandataire \u00e0 leurs valeurs syst\u00e8me par d\u00e9faut. +dlg_gsetting_title=Gsettings introuvable +dlg_gsetting_body=$appname ne peux pas fonctionner correctement sans que l'ex\u00e9cutable binary soit install\u00e9. Dans certaines distributions il peut \u00eatre trouv\u00e9 dans le paquet libglib2.0-bin. +dlg_torclient_title=Client TOR introuvable +dlg_torclient_body=$appname ne peux pas fonctionner sans que le client Tor ne soit Install\u00e9. Veuillez installer les paquets tor et tor-geoipdb pour votre distribution. +dlg_mozillarestart_title=Avertissement\u00a0: Le navigateur $browser est actif. +dlg_mozillarestart_body=$appname a d\u00e9tect\u00e9 que le navigateur $browser tourne d\u00e9j\u00e0.\nUn red\u00e9marrage du navigateur est exig\u00e9 pour permettre le fonctionnement de $appname.\n\nSi vous choisissez de red\u00e9marrer $browser, tous les onglets actuellement ouverts seront restaur\u00e9s au red\u00e9marrage de $browser, l'option \u00ab Afficher les dernier onglets et fen\u00eatres utilis\u00e9s \u00bb, doit \u00eatre choisie dans les options de $browser.\n\nVous pouvez d\u00e9sactiver cet avertissement du navigateur dans les Pr\u00e9f\u00e9rences de $appname. +dlg_license_title=Licence de $appname +dlg_exportuser_title=Exporter les mod\u00e8les d'utilisateur +dlg_exportuser_body=Aucun mod\u00e8le cr\u00e9\u00e9 par l'utilisateur n'a \u00e9t\u00e9 trouv\u00e9.\n\nUtilisez l'\u00e9diteur de mode pour ajouter vos propres mod\u00e8les +dlg_exportdefault_title=Exporter les mod\u00e8les par d\u00e9faut +dlg_exportdefault_body=Aucun mod\u00e8le par d\u00e9faut n'a \u00e9t\u00e9 trouv\u00e9. +dlg_saveuser_title=Enregistrer les modes de l'utilisateur +dlg_savedefault_title=Enregistrer les mod\u00e8les par d\u00e9faut +dlg_import_title=Importer le fichier des mod\u00e8les +dlg_import_success_title=Mod\u00e8les import\u00e9s +dlg_import_success_body=Les mod\u00e8les ont \u00e9t\u00e9 import\u00e9s avec succ\u00e8s et sont maintenant actifs. +dlg_import_fail_title=\u00c9chec lors l'importation +dlg_import_fail_body=Les mod\u00e8les n'ont pas \u00e9t\u00e9 import\u00e9s correctement. +dlg_whois_title=Qui est $ipaddress +dlg_whois_body=Veuillez patienter pendant que j'essaie de r\u00e9cup\u00e9rer les donn\u00e9s de WhoIs... +dlg_whois_fail=D\u00e9sol\u00e9, impossible de r\u00e9cup\u00e9rer les informations de Whois. +dlg_toold_body=Le client Tor actuellement install\u00e9 est trop ancien, Tor 0.2.7.6 ou ult\u00e9rieure est exig\u00e9e.\n\nLes utilisateurs de Linux devraient visiter la page suivante \nhttps://www.torproject.org/download/download-unix.html.en\npour obtenir le dernier client Tor. +dlg_error_title=Erreur de d\u00e9marrage +dlg_error_body=Cette erreur est fatale et $appname se fermera. +dlg_quickadd_title=Ajouter un mod\u00e8le +dlg_nodelistfail_body=La g\u00e9n\u00e9ration de la liste des n\u0153uds a \u00e9chou\u00e9 \u00e0 cause d'erreurs de GEOIP. +dlg_patterneditsave_title=Enregistrer les mod\u00e8les actuels +dlg_patterneditsave_body=Les mod\u00e8les actuels ont \u00e9t\u00e9 modifi\u00e9s.\n\nSi vous d\u00e9sirez les enregistrer, cliquez sur Continuer, autrement cliquez sur Annuler. +dlg_instancefail_title=\u00c9chec d\u00fb \u00e0 plusieurs instances +dlg_instancefail_body=Une instance de $appname est d\u00e9j\u00e0 en cours et une seule peut \u00eatre ex\u00e9cut\u00e9e \u00e0 la fois.\n\nQuittez l'instance existante de $appname ou dans le cas d'un plantage de $appname, red\u00e9marrez X en vous d\u00e9connectant et en vous connectant de nouveau. +dlg_guardwarn_title=Avertissement de n\u0153ud de garde +dlg_guardwarn_body=Un n\u0153ud de garde ne se trouvant pas dans votre liste de n\u0153uds de garde sp\u00e9cifi\u00e9e a \u00e9t\u00e9 utilis\u00e9.\nCeci provient probablement du fait que vos n\u0153uds de garde s\u00e9lectionn\u00e9s ne sont plus joignables et par cons\u00e9quent le client Tor a assign\u00e9 son propre n\u0153ud de garde.\n\nVous devriez v\u00e9rifier vos n\u0153uds de garde actuellement d\u00e9finis pour voir s'ils sont toujours disponibles, ou en choisir de nouveaux. +dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus.dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus. +dlg_bridgerr_title=\u00c9chec de validation de l'adresse de pont +dlg_bridgerr_body=Les informations de pont fournies contiennent des erreurs de validation et ne se conforment pas \u00e0 un format d'adresse IPv4 valide h\u00f4te:port\n\nVoici des exemples de format de sp\u00e9cification de ponts :\n\nPont simple : \n127.0.0.1:8080\n\nPonts multiples : \n127.0.0.1:8080,128.5.6.8:224\n\nLes ponts ont \u00e9t\u00e9 r\u00e9initialis\u00e9s \u00e0 leurs valeurs par d\u00e9faut. +dlg_credits_title=Cr\u00e9dits de $appname +dlg_credits_body=Afin que votre nom apparaissent ici et pour aussi m\u00e9riter ma gratitude, veuillez envisager de soutenir le d\u00e9veloppement futur de SelekTOR sous Linux avec Patreon. +table_popup_details=D\u00e9tails +table_popup_whois=Qui est +table_popup_begintest=Commencer le cycle de test +tab_basic=De base +tab_advanced=Avanc\u00e9 +isoA1=Mandataire annonyme +isoO1=autre Pays +isoU1=Inconnu +chkbox_disablenotify=D\u00e9sactiver les notifications du bureau +ttip_disablenotify=D\u00e9sactiver les notifications du bureau +dlg_libnotify_title=notify-send est introuvable +dlg_libnotify_body=Les notifications de bureau ne fonctionneront pas sans que le paquet libnotify-bin ne soit install\u00e9.\n\nPour emp\u00eacher que cette fen\u00eatre apparaissent de nouveau installez le paquet exig\u00e9 ou d\u00e9sactivez les notifications de bureau dans les pr\u00e9f\u00e9rences. +ttip_hidemin=L'appli sera cach\u00e9e au lieu d'\u00eatre minimis\u00e9e. +chkbox_hidemin=Cacher au lieu de minimiser +label_autoselect= Mode de s\u00e9lection automatique : +menu_geoip=Mettre GEOIP \u00e0 jour +chkbox_geocheck=V\u00e9rification trimestrielle des mises \u00e0 jour GEOIP +ttip_geocheck=SelekTOR affichera la \u00abfen\u00eatre de mise \u00e0 jour GEOIP \u00bbsi votre base de donn\u00e9es GEOIP est p\u00e9rim\u00e9e. +dlg_geo_title=Mise \u00e0 jour des donn\u00e9es de g\u00e9olocalisation +dlg_geo_body=Les donn\u00e9es de g\u00e9olocalisation fournies par Tor sont parfois p\u00e9rim\u00e9es. Vous pouvez demander \u00e0 SelekTOR de t\u00e9l\u00e9charger ses propres fichiers de donn\u00e9es de g\u00e9olocalisation de Dazzleships.net et de les utiliser. Ils sont mis \u00e0 jour trimestriellement.\n\nVeuillez noter que si vous choisissez de ne pas mettre \u00e0 jour, certains n\u0153uds pourraient \u00eatre assign\u00e9s au mauvais pays.\n\nLes donn\u00e9es des ces fichiers, comme les donn\u00e9es fournies par le client Tor, sont fournies par Maxmind.com. +dload_status_contact=R\u00e9cup\u00e9ration des derni\u00e8res donn\u00e9es GEOIP +dload_status_failed=\u00c9chec de t\u00e9l\u00e9chargement +chkbox_viator=T\u00e9l\u00e9charger par Tor +ttip_patterntable=\u00c9dition en ligne prise en charge, un double-clic gauche lance l'\u00e9dition d'une cellule d'un tableau. +fileext_pattern=Fichiers de mod\u00e8les zipp\u00e9 \ No newline at end of file diff --git a/src/resources/MessagesBundle_fr_LU.properties b/src/resources/MessagesBundle_fr_LU.properties new file mode 100644 index 0000000..777dff6 --- /dev/null +++ b/src/resources/MessagesBundle_fr_LU.properties @@ -0,0 +1,256 @@ +# French CA, Default language file, provided by yahoe001 +gpltransurl=https://fsffrance.org/gpl/gpl-fr.fr.html +appdesc=$appname $appver, Les n\u0153uds de sortie de Tor simplifi\u00e9s. +text_yes=Oui +text_no=Non +wintitle_prefs = Pr\u00e9f\u00e9rences de $appname +wintitle_about = \u00c0 propos de $appname +wintitle_patternedit = \u00c9diteur de mod\u00e8les $appname +wintitle_guardnodes=S\u00e9lection des n\u0153uds de garde +wintitle_tormonitor=Moniteur du client Tor +textfield_unknown=Inconnu +progstatus_initial=Initialisation... +progstatus_bridges=Mise en place du changement de ponts. +progstatus_generate=G\u00e9n\u00e9ration d'une nouvelle liste de n\u0153uds, veuillez patienter. +progstatus_cachedated=Les descripteurs en cache sont p\u00e9rim\u00e9s, ils seront renouvel\u00e9s. +progstatus_nonet=L'acc\u00e8s \u00e0 Internet n'est pas disponible. +progstatus_checkrecommended=Recherche des derniers n\u0153uds recommand\u00e9s. +progstatus_torfailretry=\u00c9chec lors du d\u00e9marrage de Tor, nouvel essai. +progstatus_nodefail=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. +progstatus_nodefailretry=\u00c9chec lors de l'activation du n\u0153ud demand\u00e9. Nouvel essai, veuillez patienter. +progstatus_nodefailtorchoose=Le n\u0153ud demand\u00e9 n'est pas joignable, Tor en choisira un, veuillez patienter. +progstatus_nodeactive3hop=Le circuit \u00e0 3 sauts vers le n\u0153ud de sortie $nodename est actif. +progstatus_nodeactive2hop=Le circuit \u00e0 2 sauts vers le n\u0153ud de sortie $nodename est actif. +progstatus_autoswitch=Auto-commutation vers le n\u0153ud +progstatus_manswitch=Commutation vers le n\u0153ud choisi manuellement +progstatus_waitfortor=Attente d'activation d'un n\u0153ud par Tor. +progstatus_switchtonode=Commutation vers le n\u0153ud $nodename. +progstatus_applychanges=Mise en place des nouvelles pr\u00e9f\u00e9rences. +circuit_status_creating_2hop=Cr\u00e9ation d'un circuit \u00e0 2 sauts. +circuit_status_creating_3hop=Cr\u00e9ation d'un circuit \u00e0 3 sauts. +circuit_status_testing=Test du circuit. +circuit_status_aborted=Test interrompu. +circuit_status_built=$1 circuit(s) construit(s). +circuit_status_passed=Circuit v\u00e9rifi\u00e9. +circuit_status_failed=\u00c9chec de circuit. +circuit_status_none=Aucun circuit n'est disponible. +circuit_status_noroute=Routeurs (tous) hors service. +combo_proxymode1=D\u00e9sactiv\u00e9 +combo_proxymode2=Relais par mod\u00e8le +combo_proxymode3=Relayer tout le trafic +combo_loglev1=D\u00e9bogage +combo_loglev2=Infos +combo_loglev3=Avis +traymenu_proxymode1=Mode : pas de relais +traymenu_proxymode2=Mode : relais par mod\u00e8le +traymenu_proxymode3=Mode : relayer tout le trafic +traymenu_showgui=Cacher/Montrer l'IUG +traytool_guardnode=Noeud de garde +traytool_exitnode=Noeud de sortie +exittable_col1=N\u0153ud de sortie +exittable_col2=BP (MB\\s) +exittable_col3=D\u00e9lai (ms) +exittable_col4=\u00c9tat +exittable_col5=Favori +patterntable_col1=Description +patterntable_col2=Mod\u00e8le +patterntable_col3=Activ\u00e9 +guardtable_col1=N\u0153ud de garde +guardtable_col2=Pays +guardtable_col3=BP (MB\\s) +guardtable_col4=De confiance +menu_menu=Menu +menu_prefs=Pr\u00e9f\u00e9rences +menu_quickadd=Ajout rapide d'un mod\u00e8le +menu_patternedit=\u00c9diteur de mod\u00e8les de relais +menu_export=Exporter les mod\u00e8les +menu_import=Import les mod\u00e8les +menu_quit=Quitter +menu_defaultpatterns=Mod\u00e8le par d\u00e9faut +menu_userpatterns=Mod\u00e8les de l'utilisateur +menu_help=Aide +menu_debuglog=Voir le journal de d\u00e9bogage +menu_helpcontents=Contenu de l'aide +menu_torcheck=V\u00e9rification de routine de Tor +menu_about=\u00c0 propos de +menu_license=Licence +menu_proxy=Mode de relais +menu_close=Fermer le menu +menu_tormanual=Manuel officiel de Tor +menu_tormonitor=Moniteur du client Tor +menu_leaktest=Test de fuite DNS +menu_credits=Cr\u00e9dits +label_activecountry=Pays actif : +label_proxymode=Mode de relais : +label_exitnode=N\u0153ud de sortie : +label_ip=IP : +label_torlatency=D\u00e9lai +label_fingerprint=Empreinte : +label_bandwidth=Bande passante +label_streams=Flux +label_stable=Stable +label_status=\u00c9tat : +label_listenport=Port d'\u00e9coute de Tor : +label_defaultproxy=Mandataire HTTP par d\u00e9faut : +label_bridgeaddress=Adresse de pont de Tor : +label_portranges=Plages de port pr\u00e9sentement actives, de $portmin \u00e0 $portmax +label_editcountry=Choisir un pays pour voir ses mod\u00e8les +label_quickadd_desc=Description : +label_quickadd_pattern=Mod\u00e8le : +label_threshold=D\u00e9lai seuil +label_middle=Milieu : +label_exit=Sortie : +label_nickname=Pseudonyme +label_ip=IP +label_country=Pays +label_guard_minimum=Vous pouvez soit ne choisir aucun n\u0153ud de garde au cas o\u00f9 le client Tor les choisit, soit choisir trois n\u0153uds de garde ou plus. +label_torlogging=Niveau de journalisation : +label_torargs=Arguments de d\u00e9marrage : +label_torsocks=Param\u00e8tres Socks : +label_diskoptions=Options du disque : +label_guardnode=Garde : +label_bridgenode=Pont : +label_donotproxy=Ne pas relayer : +button_details=D\u00e9tails +button_whois=Qui est +button_close=Fermer +button_apply=Appliquer +button_delete=Supprimer +button_addnew=Ajouter un nouveau +button_save=Enregistrer +button_cancel=Annuler +button_continue=Continuer +button_getbridges=Obtenir des ponts +button_mozillarestart=Red\u00e9marrer $browser +button_visitus=Rendez-nous visite +button_contactus=Contactez-nous +button_translations=Traductions non officielles +button_prefdefaults=R\u00e9initialiser aux leurs valeurs par d\u00e9faut. +button_setguards=D\u00e9finir les n\u0153uds de garde +button_details=D\u00e9tails de l'atlas +button_clearguards=Effacer les n\u0153uds de garde choisis +button_clearfavs=Effacer les favoris +button_support=Soutenir SelekTOR +button_patreon=Soutenir SelekTOR avec Patreon +panel_general=Param\u00e8tres g\u00e9n\u00e9raux +panel_network= Param\u00e8tres r\u00e9seau +panel_management=Param\u00e8tres de gestion des n\u0153uds +panel_info=Circuit actif +panel_torclientset=Param\u00e8tres du client Tor +panel_startupargs=Arguments de d\u00e9marrage +panel_stdout=Moniteur de sortie standard +chkbox_autoselect=Choix automatique du n\u0153ud +chkbox_autostart=D\u00e9marrage automatique de SelekTOR +chkbox_checkforupdates=V\u00e9rifier les mises \u00e0 jour au d\u00e9marrage +chkbox_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification +chkbox_autopatterns=Installer automatiquement les derniers mod\u00e8les. +chkbox_mozillawarn=D\u00e9sactiver l'avertissement de Mozilla +chkbox_recnodesonly=Utiliser les n\u0153uds recommand\u00e9s en mode par mod\u00e8les +chkbox_hidetotray=Minimiser au d\u00e9marrage +chkbox_minonclose=Minimiser plut\u00f4t que de quitter lors de la fermeture +chkbox_safesocks=Socks s\u00e9curitaire +chkbox_twohop=Utiliser des circuits \u00e0 2 sauts vers le n\u0153ud de sortie en mode par mod\u00e8les +chkbox_warnunsafesocks=Avertir si \u00e0 risque +chkbox_diskavoid=\u00c9viter les \u00e9critures sur le disque +chkbox_testsocks=Tester Socks +chkbox_safelog=Journalisation s\u00e9curitaire +chkbox_guardwarn1=Afficher une fen\u00eatre d'avertissement si un n\u0153ud de garde non sp\u00e9cifi\u00e9 est utilis\u00e9 +chkbox_guardwarn2=Afficher une fen\u00eatre d'avertissement si moins de trois n\u0153uds de garde sont choisis +chkbox_securedelete=Effacement s\u00e9curis\u00e9 des caches de Tor lors de la fermeture +ttip_autostart=D\u00e9marrage automatique de SelekTOR lors du d\u00e9marrage/de la connexion +ttip_hidetotray=Minimiser au d\u00e9marrage +ttip_checkforupdates=SelekTOR v\u00e9rifiera les mises \u00e0 jour au d\u00e9marage +ttip_autoinstall=Les derniers mod\u00e8les seront r\u00e9cup\u00e9r\u00e9s de Dazzleships.Net +ttip_disabletray=D\u00e9sactiver l'ic\u00f4ne de notification +ttip_mozillawarn=D\u00e9sactiver l'avertissement du navigateur Mozilla +ttip_listenport=Le port d'\u00e9coute du client Tor +ttip_defaultproxy=Tout trafic qui ne sera pas redirig\u00e9 par Tor sera redirig\u00e9 par ce mandataire HTTP +ttip_donotproxy=Toute URL contenant une de ces entr\u00e9es s\u00e9par\u00e9es par des virgules ne sera pas relay\u00e9e. L'on s'y connectera directement. +ttip_bridgeaddress=Pour contourner le blocage du FSI, ajouter une adresse de pont valide ici +ttip_forcedns=Forcer la recherche DNS par Tor, exige le red\u00e9marrage du navigateur +ttip_forcenode=Si coch\u00e9, le n\u0153ud sera activ\u00e9 quelque soit l'activit\u00e9 du n\u0153ud +ttip_recnodesonly=Les n\u0153uds recommand\u00e9s seront utilis\u00e9s en mode par mod\u00e8les +ttip_minonclose=L'application sera minimis\u00e9e au lieu de quitter \u00e0 la fermeture de la fermeture principale +ttip_threshold=D\u00e9lai seuil +ttip_safesocks=Activ\u00e9e, Tor rejettera les connexions logicielles qui utilisent des variantes dangereuses du protocole Socks. +ttip_warnunsafe=Activ\u00e9e, Tor avertira \u00e0 chaque fois qu'une requ\u00eate est re\u00e7ue contenant seulement une adresse IP au lieu d'un nom d'h\u00f4te. +ttip_testsocks=Activ\u00e9e Tor journalisera une entr\u00e9e de journal de niveau avis pour chaque connexion en indiquant si elle utilise un protocole Socks s\u00e9curitaire ou dangereux. +ttip_safelogging=Activ\u00e9e, Tor nettoiera les cha\u00eenes potentiellement sensibles des messages de journalisation. +ttip_avoiddisk=Activ\u00e9e, Tor essaiera d'\u00e9crire moins fr\u00e9quemment sur le disque que nous ne le ferions autrement. +ttip_extraargs= Arguments suppl\u00e9mentaires sp\u00e9cifi\u00e9s par l'utilisateur, voir le Manuel Tor. +ttip_combo_loglevel=Niveau de journalisation de Tor. +ttip_twohop=Utiliser des circuits \u00e0 2 sauts au lieu des 3 par d\u00e9faut de Tor. R\u00e9duit le d\u00e9lai de transit mais affaiblit l'anonymat. +ttip_resetbasicprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences de base \u00e0 leurs valeurs par d\u00e9faut. +ttip_resetadvprefs=R\u00e9initialiser les pr\u00e9f\u00e9rences avanc\u00e9es \u00e0 leurs valeurs par d\u00e9faut. +ttip_guardwarn1=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant qu'un n\u0153ud de garde non sp\u00e9cifi\u00e9 est actif. +ttip_guardwarn2=Activ\u00e9, une fen\u00eatre d'avertissement sera affich\u00e9e indiquant que trop peu de n\u0153uds de garde sont choisis +ttip_clearguards=Effacer les n\u0153uds de garde choisis. +ttip_securedelete=Activ\u00e9, les caches de Tor seront \u00e9cras\u00e9es par des z\u00e9ros, puis supprim\u00e9es +dlg_update_title=Mise \u00e0 jour disponible. +dlg_update_body=$version est maintenant disponible au t\u00e9l\u00e9chargement. +dlg_restoreproxy_title=Param\u00e8tres originaux du mandataire +dlg_restoreproxy_body=Choisir Continuer pour restaurer les param\u00e8tres du mandataire aux valeurs par d\u00e9faut avant l'installation de SelekTOR. +dlg_resetproxy_title=Param\u00e8tres par d\u00e9faut du mandataire +dlg_resetproxy_body=Choisir Continuer pour r\u00e9initialiser les param\u00e8tres du serveur mandataire \u00e0 leurs valeurs syst\u00e8me par d\u00e9faut. +dlg_gsetting_title=Gsettings introuvable +dlg_gsetting_body=$appname ne peux pas fonctionner correctement sans que l'ex\u00e9cutable binary soit install\u00e9. Dans certaines distributions il peut \u00eatre trouv\u00e9 dans le paquet libglib2.0-bin. +dlg_torclient_title=Client TOR introuvable +dlg_torclient_body=$appname ne peux pas fonctionner sans que le client Tor ne soit Install\u00e9. Veuillez installer les paquets tor et tor-geoipdb pour votre distribution. +dlg_mozillarestart_title=Avertissement\u00a0: Le navigateur $browser est actif. +dlg_mozillarestart_body=$appname a d\u00e9tect\u00e9 que le navigateur $browser tourne d\u00e9j\u00e0.\nUn red\u00e9marrage du navigateur est exig\u00e9 pour permettre le fonctionnement de $appname.\n\nSi vous choisissez de red\u00e9marrer $browser, tous les onglets actuellement ouverts seront restaur\u00e9s au red\u00e9marrage de $browser, l'option \u00ab Afficher les dernier onglets et fen\u00eatres utilis\u00e9s \u00bb, doit \u00eatre choisie dans les options de $browser.\n\nVous pouvez d\u00e9sactiver cet avertissement du navigateur dans les Pr\u00e9f\u00e9rences de $appname. +dlg_license_title=Licence de $appname +dlg_exportuser_title=Exporter les mod\u00e8les d'utilisateur +dlg_exportuser_body=Aucun mod\u00e8le cr\u00e9\u00e9 par l'utilisateur n'a \u00e9t\u00e9 trouv\u00e9.\n\nUtilisez l'\u00e9diteur de mode pour ajouter vos propres mod\u00e8les +dlg_exportdefault_title=Exporter les mod\u00e8les par d\u00e9faut +dlg_exportdefault_body=Aucun mod\u00e8le par d\u00e9faut n'a \u00e9t\u00e9 trouv\u00e9. +dlg_saveuser_title=Enregistrer les modes de l'utilisateur +dlg_savedefault_title=Enregistrer les mod\u00e8les par d\u00e9faut +dlg_import_title=Importer le fichier des mod\u00e8les +dlg_import_success_title=Mod\u00e8les import\u00e9s +dlg_import_success_body=Les mod\u00e8les ont \u00e9t\u00e9 import\u00e9s avec succ\u00e8s et sont maintenant actifs. +dlg_import_fail_title=\u00c9chec lors l'importation +dlg_import_fail_body=Les mod\u00e8les n'ont pas \u00e9t\u00e9 import\u00e9s correctement. +dlg_whois_title=Qui est $ipaddress +dlg_whois_body=Veuillez patienter pendant que j'essaie de r\u00e9cup\u00e9rer les donn\u00e9s de WhoIs... +dlg_whois_fail=D\u00e9sol\u00e9, impossible de r\u00e9cup\u00e9rer les informations de Whois. +dlg_toold_body=Le client Tor actuellement install\u00e9 est trop ancien, Tor 0.2.7.6 ou ult\u00e9rieure est exig\u00e9e.\n\nLes utilisateurs de Linux devraient visiter la page suivante \nhttps://www.torproject.org/download/download-unix.html.en\npour obtenir le dernier client Tor. +dlg_error_title=Erreur de d\u00e9marrage +dlg_error_body=Cette erreur est fatale et $appname se fermera. +dlg_quickadd_title=Ajouter un mod\u00e8le +dlg_nodelistfail_body=La g\u00e9n\u00e9ration de la liste des n\u0153uds a \u00e9chou\u00e9 \u00e0 cause d'erreurs de GEOIP. +dlg_patterneditsave_title=Enregistrer les mod\u00e8les actuels +dlg_patterneditsave_body=Les mod\u00e8les actuels ont \u00e9t\u00e9 modifi\u00e9s.\n\nSi vous d\u00e9sirez les enregistrer, cliquez sur Continuer, autrement cliquez sur Annuler. +dlg_instancefail_title=\u00c9chec d\u00fb \u00e0 plusieurs instances +dlg_instancefail_body=Une instance de $appname est d\u00e9j\u00e0 en cours et une seule peut \u00eatre ex\u00e9cut\u00e9e \u00e0 la fois.\n\nQuittez l'instance existante de $appname ou dans le cas d'un plantage de $appname, red\u00e9marrez X en vous d\u00e9connectant et en vous connectant de nouveau. +dlg_guardwarn_title=Avertissement de n\u0153ud de garde +dlg_guardwarn_body=Un n\u0153ud de garde ne se trouvant pas dans votre liste de n\u0153uds de garde sp\u00e9cifi\u00e9e a \u00e9t\u00e9 utilis\u00e9.\nCeci provient probablement du fait que vos n\u0153uds de garde s\u00e9lectionn\u00e9s ne sont plus joignables et par cons\u00e9quent le client Tor a assign\u00e9 son propre n\u0153ud de garde.\n\nVous devriez v\u00e9rifier vos n\u0153uds de garde actuellement d\u00e9finis pour voir s'ils sont toujours disponibles, ou en choisir de nouveaux. +dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus.dlg_notenoughguards_body=Il n'y a pas assez de n\u0153uds de garde d\u00e9finis afin que Tor fonctionne efficacement et en toute s\u00e9curit\u00e9.\n\nSupprimez tous les n\u0153uds de garde s\u00e9lectionn\u00e9s, ce qui permettra au client Tor de choisir ses propres n\u0153uds de garde, ou choisissez manuellement trois n\u0153uds de garde ou plus. +dlg_bridgerr_title=\u00c9chec de validation de l'adresse de pont +dlg_bridgerr_body=Les informations de pont fournies contiennent des erreurs de validation et ne se conforment pas \u00e0 un format d'adresse IPv4 valide h\u00f4te:port\n\nVoici des exemples de format de sp\u00e9cification de ponts :\n\nPont simple : \n127.0.0.1:8080\n\nPonts multiples : \n127.0.0.1:8080,128.5.6.8:224\n\nLes ponts ont \u00e9t\u00e9 r\u00e9initialis\u00e9s \u00e0 leurs valeurs par d\u00e9faut. +dlg_credits_title=Cr\u00e9dits de $appname +dlg_credits_body=Afin que votre nom apparaissent ici et pour aussi m\u00e9riter ma gratitude, veuillez envisager de soutenir le d\u00e9veloppement futur de SelekTOR sous Linux avec Patreon. +table_popup_details=D\u00e9tails +table_popup_whois=Qui est +table_popup_begintest=Commencer le cycle de test +tab_basic=De base +tab_advanced=Avanc\u00e9 +isoA1=Mandataire annonyme +isoO1=autre Pays +isoU1=Inconnu +chkbox_disablenotify=D\u00e9sactiver les notifications du bureau +ttip_disablenotify=D\u00e9sactiver les notifications du bureau +dlg_libnotify_title=notify-send est introuvable +dlg_libnotify_body=Les notifications de bureau ne fonctionneront pas sans que le paquet libnotify-bin ne soit install\u00e9.\n\nPour emp\u00eacher que cette fen\u00eatre apparaissent de nouveau installez le paquet exig\u00e9 ou d\u00e9sactivez les notifications de bureau dans les pr\u00e9f\u00e9rences. +ttip_hidemin=L'appli sera cach\u00e9e au lieu d'\u00eatre minimis\u00e9e. +chkbox_hidemin=Cacher au lieu de minimiser +label_autoselect= Mode de s\u00e9lection automatique : +menu_geoip=Mettre GEOIP \u00e0 jour +chkbox_geocheck=V\u00e9rification trimestrielle des mises \u00e0 jour GEOIP +ttip_geocheck=SelekTOR affichera la \u00abfen\u00eatre de mise \u00e0 jour GEOIP \u00bbsi votre base de donn\u00e9es GEOIP est p\u00e9rim\u00e9e. +dlg_geo_title=Mise \u00e0 jour des donn\u00e9es de g\u00e9olocalisation +dlg_geo_body=Les donn\u00e9es de g\u00e9olocalisation fournies par Tor sont parfois p\u00e9rim\u00e9es. Vous pouvez demander \u00e0 SelekTOR de t\u00e9l\u00e9charger ses propres fichiers de donn\u00e9es de g\u00e9olocalisation de Dazzleships.net et de les utiliser. Ils sont mis \u00e0 jour trimestriellement.\n\nVeuillez noter que si vous choisissez de ne pas mettre \u00e0 jour, certains n\u0153uds pourraient \u00eatre assign\u00e9s au mauvais pays.\n\nLes donn\u00e9es des ces fichiers, comme les donn\u00e9es fournies par le client Tor, sont fournies par Maxmind.com. +dload_status_contact=R\u00e9cup\u00e9ration des derni\u00e8res donn\u00e9es GEOIP +dload_status_failed=\u00c9chec de t\u00e9l\u00e9chargement +chkbox_viator=T\u00e9l\u00e9charger par Tor +ttip_patterntable=\u00c9dition en ligne prise en charge, un double-clic gauche lance l'\u00e9dition d'une cellule d'un tableau. +fileext_pattern=Fichiers de mod\u00e8les zipp\u00e9 \ No newline at end of file diff --git a/src/resources/MessagesBundle_pt_BR.properties b/src/resources/MessagesBundle_pt_BR.properties new file mode 100644 index 0000000..dbb5e2c --- /dev/null +++ b/src/resources/MessagesBundle_pt_BR.properties @@ -0,0 +1,261 @@ +# Portuguese BR, Default language file, provide by Paulo Roberto Alves de Oliveira (aka kretcheu) Licensed by GPL-2+ +appdesc=$appname $appver, N\u00f3s de sa\u00edda Tor com simplicidade. +text_yes=Sim +text_no=N\u00e3o +text_mode=N\u00f3 +wintitle_prefs = Prefer\u00eancias $appname +wintitle_about = Sobre $appname +wintitle_patternedit = Editor de modelos $appname +wintitle_guardnodes=Sele\u00e7\u00e3o de n\u00f3s guarda +wintitle_tormonitor=Monitor do cliente Tor +textfield_unknown=Desconhecido +progstatus_initial=Iniciando... +progstatus_generate=Gerando lista de n\u00f3s, por favor aguarde. +progstatus_cachedated=Descri\u00e7\u00f5es armazenadas desatualizadas, iremos atualiz\u00e1-las. +progstatus_nonet=Acesso a Internet n\u00e3o dispon\u00edvel. +progstatus_checkrecommended=Verificando os \u00faltimos n\u00f3s recomendados. +progstatus_gotrecommended=Lista de n\u00f3s recomendados recuperados. +progstatus_torfailretry=O Tor falhou ao iniciar, tentando novamente. +progstatus_nodefail=Ativa\u00e7\u00e3o requisitada do n\u00f3 falhou. +progstatus_nodefailretry=Ativa\u00e7\u00e3o requisitada do n\u00f3 falhou, tentaremos novamente, por favor aguarde. +progstatus_nodefailtorchoose=N\u00f3 requisitado fora de alcance, deixaremos o Tor escolher. +progstatus_nodeactive3hop=Circuito de 3 saltos do n\u00f3 de sa\u00edda $nodename est\u00e1 ativo. +progstatus_nodeactive2hop=Cirtuito de 2 saltos do n\u00f3 de sa\u00edda $nodename est\u00e1 ativo. +progstatus_autoswitch=Troca autom\u00e1tica de n\u00f3 +progstatus_manswitch=Trocando para n\u00f3 manualmente selecionado. +progstatus_waitfortor=Aguardando ativa\u00e7\u00e3o do n\u00f3 pelo Tor. +progstatus_switchtonode=Trocando para o n\u00f3 $nodename. +progstatus_applychanges=Aplicando novas prefer\u00eancias. +circuit_status_creating_2hop=Criando circuito de 2 saltos. +circuit_status_creating_3hop=Criando circuito de 3 saltos. +circuit_status_testing=Testanto circuito. +circuit_status_aborted=Teste cancelado. +circuit_status_built=Circuito $1 constru\u00eddo. +circuit_status_passed=Circuito passou. +circuit_status_failed=Circuito falhou. +circuit_status_none=Nenhum circuito dispon\u00edvel. +circuit_status_noroute=Todos roteadores fora. +combo_proxymode1=Desabilitado +combo_proxymode2=Proxy por modelo +combo_proxymode3=Proxy para todo tr\u00e1fego +combo_loglev1=Depura\u00e7\u00e3o +combo_loglev2=Informa\u00e7\u00e3o +combo_loglev3=Aviso +traymenu_proxymode1=Modo: Proxy Desabilitado +traymenu_proxymode2=Modo: Proxy por modelo +traymenu_proxymode3=Modo: Proxy para todo tr\u00e1fego +traymenu_showgui=Esconde/Mostra GUI +traytool_guardnode=N\u00f3 guarda +traytool_exitnode=N\u00f3 de sa\u00edda +exittable_col1=N\u00f3 de sa\u00edda +exittable_col2=Largura de Banda (MB\/s) +exittable_col3=Lat\u00eancia (ms) +exittable_col4=Estado +exittable_col5=Favorito +guardtable_col1=N\u00f3 guarda +guardtable_col2=Pa\u00eds +guardtable_col3=Largura de Banda (MB\/s) +guardtable_col4=Confi\u00e1vel +patterntable_col1=Descri\u00e7\u00e3o +patterntable_col2=Modelo +patterntable_col3=Habilitado +menu_menu=Menu +menu_prefs=Prefer\u00eancias +menu_quickadd=Adicione modelo rapidamente +menu_patternedit=Editor de modelo de proxy +menu_export=Exporta\u00e7\u00e3o de modelos +menu_import=Importa\u00e7\u00e3o de modelos +menu_quit=Sair +menu_defaultpatterns=Modelos padr\u00e3o +menu_userpatterns=Modelos de usu\u00e1rio +menu_help=Ajuda +menu_debuglog=Ver log de depura\u00e7\u00e3o +menu_helpcontents=Conte\u00fado de ajuda +menu_torcheck=Verificar roteamento Tor +menu_about=Sobre +menu_license=Licen\u00e7a +menu_tormanual=Manual oficial do Tor +menu_tormonitor=Monitor de cliente Tor +menu_close=Menu fechar +menu_proxy=Modo Proxy +menu_leaktest=Testar vazamento de DNS +menu_credits=Cr\u00e9ditos +label_latency_url=URL de verifica\u00e7\u00e3o de lat\u00eancia do Tor: +label_guardnode=Guarda: +label_bridgenode=Ponte: +label_activecountry=Pa\u00eds de sa\u00edda: +label_proxymode=Modo do proxy: +label_exitnode=N\u00f3 de sa\u00edda: +label_torlatency=Lat\u00eancia +label_fingerprint=Impress\u00e3o digital: +label_bandwidth=Largura de banda +label_streams=Fluxos +label_stable=Est\u00e1vel +label_status=Estado do cliente: +label_listenport=Porta de escuta do Tor: +label_defaultproxy=Proxy HTTP padr\u00e3o: +label_bridgeaddress=Endere\u00e7o de ponte Tor: +label_portranges=Intervalo atual de portas, $portmin at\u00e9 $portmax +label_editcountry=Selecione o pa\u00eds para ver seu modelo +label_quickadd_desc=Descri\u00e7\u00e3o: +label_quickadd_pattern=Modelo: +label_threshold=Limite +label_exitip=IP de sa\u00edda: +label_guardip=IP do n\u00f3 guarda: +label_guardcountry=Pa\u00eds do n\u00f3 guarda: +label_torlogging=N\u00edvel de log: +label_torargs=Par\u00e2metros iniciais: +label_torsocks=Configura\u00e7\u00e3o do Socks: +label_diskoptions=Op\u00e7\u00f5es de disco: +label_guard_minimum=Voc\u00ea pode tanto n\u00e3o ter n\u00f3s guarda selecionados, nesse caso o cliente Tor ir\u00e1 escolher ou ter 3 ou mais n\u00f3s guarda selecionados. +label_nickname=Apelido +label_ip=IP +label_country=Pa\u00eds +label_exit=Sa\u00edda: +label_middle=Meio: +label_donotproxy=Sem proxy: +button_details=Detalhes do atlas +button_whois=WhoIs +button_close=Fechar +button_apply=Aplicar +button_delete=Apagar +button_addnew=Adicionar novo +button_save=Salvar +button_cancel=Cancelar +button_continue=Continuar +button_getbridges=Obter pontes +button_mozillarestart=Reiniciar $browser +button_visitus=Visite-nos +button_contactus=Contacte-nos +button_translations=Tradu\u00e7\u00f5es n\u00e3o oficiais +button_prefdefaults=Restaurar padr\u00f5es +button_setguards=Definir n\u00f3s guarda +button_clearguards=Limpar n\u00f3s guarda selecionados +button_clearfavs=Limpar Favoritos +button_support=Apoie o SelekTOR +button_patreon=Apoie o SelekTOR com Patreon +panel_info=Circuito ativo +panel_general=Configura\u00e7\u00f5es gerais +panel_network=Configura\u00e7\u00f5es de rede +panel_management=Configura\u00e7\u00f5es de gest\u00e3o de n\u00f3s +panel_torclientset=Configura\u00e7\u00f5es do cliente Tor +panel_startupargs=Par\u00e2metros iniciais +panel_stdout=Monitor de sa\u00edda +chkbox_autoselect=Sele\u00e7\u00e3o autom\u00e1tica de n\u00f3s +chkbox_autostart=Iniciar automaticamente o SelekTOR +chkbox_checkforupdates=Verificar por atualiza\u00e7\u00f5es ao iniciar +chkbox_disabletray=Desabilitar \u00edcone da bandeja. +chkbox_autopatterns=Instalar automaticamente os \u00faltimos modelos. +chkbox_mozillawarn=Desabilitar alerta Mozilla +chkbox_recnodesonly=Usar n\u00f3s recomendados no modelo +chkbox_hidetotray=Minimizar ao iniciar +chkbox_minonclose=Minimizar ao inv\u00e9s de sair ao fechar +chkbox_twohop=Usar circuitos de 2 saltos para n\u00f3 de sa\u00edda no modelo +chkbox_safesocks=Socks seguro +chkbox_warnunsafesocks=Avisar se inseguro +chkbox_diskavoid=Evitar escrita no disco +chkbox_testsocks=Testar Socks +chkbox_safelog=Logging seguro +chkbox_guardwarn1=Alertar se um n\u00f3 guarda n\u00e3o especificado for usado +chkbox_securedelete=Apagar dados armazenados do Tor ao sair +chkbox_guardwarn2=Alertar se menos de 3 n\u00f3s guardas forem selecionados +ttip_autostart=Ir\u00e1 iniciar o SelekTOR automaticamente no boot/login. +ttip_hidetotray=SelekTOR iniciar\u00e1 na bandeja do sistema +ttip_checkforupdates=SelekTOR verificar\u00e1 por nova vers\u00e3o ao iniciar +ttip_autoinstall=Buscar\u00e1 \u00faltimos modelos de Dazzleships.Net. +ttip_disabletray=Desabilitar \u00edcone na bandeja do sistema +ttip_mozillawarn=Desabilitar alerta do navegador Mozilla +ttip_listenport=Cliente Tor escutando na porta. +ttip_defaultproxy=Todo tr\u00e1fego n\u00e3o roteado pelo Tor ir\u00e1 ser redirecionado por esse proxy HTTP. +ttip_donotproxy=Qualquer URL que contenha uma ou mais dessas entradas, separadas por v\u00edrgula, ser\u00e1 conectada diretamente. +ttip_bridgeaddress=Para evitar bloqueio do provedor adicione um endere\u00e7o v\u00e1lido de ponte aqui. +ttip_forcedns=Force pesquisa de DNS via Tor, precisa reiniciar o navegador. +ttip_forcenode=Quando marcado o n\u00f3 \u00e9 ativado independente de atividade atual +ttip_enhanon=Usar\u00e1 3 saltos de n\u00f3s ao inv\u00e9s de 2 saltos. +ttip_recnodesonly=Usuar\u00e1 n\u00f3s recomendados do modelo +ttip_minonclose=A aplica\u00e7\u00e3o ir\u00e1 minimizar ao inv\u00e9s de sair ao fechar a janela principal +ttip_threshold=Limite de lat\u00eancia +ttip_safesocks=Quando habilitado, o Tor ir\u00e1 rejeitar conex\u00f5es que usam varia\u00e7\u00f5es inseguras do protocolo socks. +ttip_warnunsafe=Quando habilitado, o Tor ir\u00e1 avisar sempre que uma requisi\u00e7\u00e3o recebida contiver apenas IP ao inv\u00e9s de um nome de m\u00e1quina. +ttip_testsocks=Quando habilitado, o Tor ir\u00e1 gerar um log de n\u00edvel aviso para cada conex\u00e3o, indicando se foi usado o protocolo socks seguro ou inseguro. +ttip_safelogging=Quando habilitado, o Tor ir\u00e1 limpar o texto potencialmente cr\u00edtico das mensagens de log. +ttip_avoiddisk=Quando habilitado, o Tor tentar\u00e1 escrever no disco com menos frequ\u00eancia. +ttip_extraargs=Especifique par\u00e2metros adicionais, veja o manual do Tor. +ttip_combo_loglevel=N\u00edvel de log do Tor. +ttip_twohop=Usar circuitos de 2 saltos ao inv\u00e9s de 3 saltos, padr\u00e3o do Tor, reduz a lat\u00eancia mas diminui o anonimato. +ttip_resetbasicprefs=Restaurar as prefer\u00eancias b\u00e1sicas para seus padr\u00f5es. +ttip_resetadvprefs=Restaurar as prefer\u00eancias avan\u00e7adas para seus padr\u00f5es. +ttip_securedelete=Quando habilitado, o armazenamento do Tor ser\u00e1 sobrescrito por zeros quanto apagado. +ttip_autonode=Quando habilitado, o SelekTOR tentar\u00e1 escolher o n\u00f3 de melhor performance. +ttip_guardwarn=Quando habilitado, um alerta ser\u00e1 usado para indicar que um n\u00f3 guarda n\u00e3o especificado est\u00e1 ativo. +ttip_clearguards=Limpar n\u00f3s guarda selecionados. +ttip_guardwarn2=Quando habilitado, um alerta ser\u00e1 usado para indicar insufici\u00eancia de n\u00f3s guarda selecionados. +dlg_update_title=Atualiza\u00e7\u00e3o dispon\u00edvel. +dlg_update_body=Vers\u00e3o $version est\u00e1 dispon\u00edvel para download. +dlg_restoreproxy_title=Configura\u00e7\u00e3o original do proxy +dlg_restoreproxy_body=Selecione continue para restaurar as configura\u00e7\u00f5es originais do proxy antes da instala\u00e7\u00e3o do SelekTOR. +dlg_resetproxy_title=Configura\u00e7\u00e3o padr\u00e3o do proxy +dlg_resetproxy_body=Selecione continuar para limpar as configura\u00e7\u00f5es de proxy para o padr\u00e3o do sistema. +dlg_gsetting_title=Gsettings n\u00e3o encontrado +dlg_gsetting_body=$appname n\u00e3o funciona sem o bin\u00e1rio gsettings instalado, em algumas distribui\u00e7\u00f5es pode ser encontrado no pacote libglib2.0-bin. +dlg_torclient_title=Cliente TOR n\u00e3o encontrado +dlg_torclient_body=$appname n\u00e3o funciona sem um cliente Tor instalado, por favor instale os pacotes tor e tor-geoipdb da sua distribui\u00e7\u00e3o. +dlg_mozillarestart_title=Alerta: O navegador $browser est\u00e1 ativo. +dlg_mozillarestart_body=O $appname detectou que o navegador $browser j\u00e1 est\u00e1 em execu\u00e7\u00e3o.\nReiniciar o navegador \u00e9 necess\u00e1rio para habilitar $appname.\n\nSe escolher reiniciar o $browser todas as abas abertas ser\u00e3o restauradas quando o $browser reiniciar, requer que a op\u00e7\u00e3o \"Restaurar janelas e abas anteriores\" seja selecionada no menu prefer\u00eancias no $browser.\n\nVoc\u00ea pode desabilitar o aviso do navegador em prefer\u00eancias de $appname. +dlg_license_title=Licen\u00e7a $appname +dlg_exportuser_title=Exportar modelo de usu\u00e1rio +dlg_exportuser_body=Nenhum modelo de usu\u00e1rio encontrado.\n\nUse o editor de modelos para adicionar seus pr\u00f3rios modelos +dlg_exportdefault_title=Exporte os modelos padr\u00e3o +dlg_exportdefault_body=Nenhum modelo padr\u00e3o encontrado. +dlg_saveuser_title=Salvar o modelo de usu\u00e1rio +dlg_savedefault_title=Salvar os modelos padr\u00e3o +dlg_import_title=Importar um arquivo de modelo +dlg_import_success_title=Modelo importado +dlg_import_success_body=Modelos importados com susesso e agora ativos. +dlg_import_fail_title=Importa\u00e7\u00e3o falhou +dlg_import_fail_body=Falhou ao importar modelos. +dlg_whois_title=Whois $ipaddress +dlg_whois_body=Por favor aguarde enquanto buscando dados Whois... +dlg_whois_fail=Desculpe, n\u00e3o foi poss\u00edvel encontrar informa\u00e7\u00f5es de Whois. +dlg_toold_body=O cliente Tor atualmente instalado \u00e9 antigo, o Tor 0.2.7.6 ou mais novo \u00e9 requerido.\n\nUsu\u00e1rios de GNU/Linux podem acessar a p\u00e1gina \nhttps://www.torproject.org/download/download-unix.html.en\n para obter o cliente Tor mais recente, ou diretamente dos reposit\u00f3rios. +dlg_error_title=Erro de inicia\u00e7\u00e3o +dlg_error_body=Esse erro \u00e9 fatal e $appname ir\u00e1 fechar. +dlg_quickadd_title=Adicionar modelo +dlg_nodelistfail_body=A gera\u00e7\u00e3o da lista de n\u00f3s falhou devido a erros do GEOIP. +dlg_patterneditsave_title=Salvar os modelos atuais +dlg_patterneditsave_body=Modelos atuais foram modificados.\n\nSe voc\u00ea deseja salv\u00e1-los clique em continuar sen\u00e3o clique em cancelar. +dlg_instancefail_title=Falha de inst\u00e2ncia multipla +dlg_instancefail_body=Uma inst\u00e2ncia de $appname j\u00e1 est\u00e1 em execu\u00e7\u00e3o, somente uma inst\u00e2ncia pode ser executada por vez.\n\nFechar a inst\u00e2ncia existente de $appname ou no caso de $appname congelar reinicie o X deslogando e logando novamente. +dlg_guardwarn_title=Alerta de n\u00f3 guarda +dlg_guardwarn_body=Um n\u00f3 guarda que n\u00e3o est\u00e1 na lista de n\u00f3s guarda especificados foi usado.\nProvavelmente porque seus n\u00f3s guarda selecionados n\u00e3o s\u00e3o mais alcan\u00e7\u00e1veis e o cliente Tor escolheu seus pr\u00f3prios n\u00f3s guarda. Talvez queira verificar sua lista de n\u00f3s guarda para ver se ainda est\u00e3o dispon\u00edveis ou selecionar novos. +dlg_notenoughguards_body=N\u00e3o h\u00e1 n\u00f3s guarda suficientes para o Tor operar com seguran\u00e7a e efici\u00eancia.\n\nLimpe todos os n\u00f3s guarda selecionados e deixe o cliente Tor escolher seus pr\u00f3prios n\u00f3s guarda ou escolha 3 n\u00f3s guarda manualmente. +dlg_bridgerr_title=Falha na valida\u00e7\u00e3o do endere\u00e7o da ponte. +dlg_bridgerr_body=A informa\u00e7\u00e3o da ponte fornecida cont\u00e9m erros de valida\u00e7\u00e3o e n\u00e3o est\u00e1 em conformidade com um formato v\u00e1lido host:port endere\u00e7o ipv4.\n\nExemplos do formato de especifica\u00e7\u00e3o de pontes s\u00e3o:\n\nPonte \u00fanica:\n127.0.0.1:8080\n\nPontes m\u00faltiplas:\n127.0.0.1:8080,128.5.6.8:224\n\nAs pontes foram restauradas para os padr\u00f5es. +dlg_credits_title=Cr\u00e9ditos $appname +dlg_credits_body=Para ter seu nome listado aqui e tamb\u00e9m merecer minha gratid\u00e3o por favor apoie o desenvolvimento do SelekTOR na plataforma GNU/Linux atrav\u00e9s do Patreon +table_popup_details=Detalhes +table_popup_begintest=Inicia ciclo de teste +table_popup_whois=WhoIs +tab_basic=B\u00e1sico +tab_advanced=Avan\u00e7ado +isoA1=Proxy an\u00f4nimo +isoA2=Provedor de sat\u00e9lite +isoO1=Outro pa\u00eds +isoU1=Desconhecido +chkbox_disablenotify=Desabilitar notifica\u00e7\u00f5es +ttip_disablenotify=Desabilita notifica\u00e7\u00f5es +dlg_libnotify_title=notify-send n\u00e3o encontrado +dlg_libnotify_body=Notifica\u00e7\u00f5es n\u00e3o funcionam sem o pacote libnotify-bin instalado.\n\nPara previnir que esse alerta apare\u00e7a novamente, instale o pacote requerido ou desabilite as notifica\u00e7\u00f5es em prefer\u00eancias. +ttip_hidemin=Aplica\u00e7\u00e3o ser\u00e1 oculta ao inv\u00e9s de minimizar +chkbox_hidemin=Ocultar ao inv\u00e9s de minimizar +label_autoselect=Modo de auto sele\u00e7\u00e3o: +menu_geoip=Atualizar GEOIP +chkbox_geocheck=Fazer verifica\u00e7\u00e3o trimestral de atualiza\u00e7\u00e3o do GEOIP +ttip_geocheck=SelekTOR ir\u00e1 mostrar o "Di\u00e1logo de atualiza\u00e7\u00e3o GEOIP" se sua base de dados GEOIP estiver desatualizada. +dlg_geo_title=Atualiza\u00e7\u00e3o de dados de geolocaliza\u00e7\u00e3o +dlg_geo_body=Os dados de geolocaliza\u00e7\u00e3o padr\u00e3o vindos do cliente Tor algumas vezes est\u00e3o desatualizados, voc\u00ea pode baixar os dados de geolocaliza\u00e7\u00e3o de Dazzleships.net. Eles s\u00e3o atualizados trimestralmente.\n\nVeja, se escolher n\u00e3o atualizar, alguns n\u00f3s podem estar atribu\u00eddos a pa\u00edses errados.\n\nOs dados nesses arquivos, assim como os do cliente Tor s\u00e3o fornecidos por Maxmind.com. +dload_status_contact=Obtendo dados GEOIP mais recentes +dload_status_failed=Download falhou +chkbox_viator=Download via Tor +ttip_patterntable=Para editar, d\u00ea um duplo click na c\u00e9lula da tabela que deseja modificar. +fileext_pattern=Arquivo zip do modelo \ No newline at end of file diff --git a/src/resources/credits.txt b/src/resources/credits.txt new file mode 100644 index 0000000..fe08b77 --- /dev/null +++ b/src/resources/credits.txt @@ -0,0 +1 @@ +Alistair Neil (Developer) \ No newline at end of file diff --git a/src/resources/license.txt b/src/resources/license.txt new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/src/resources/license.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 2 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/src/resources/trayicon.png b/src/resources/trayicon.png new file mode 100644 index 0000000..ce1841e Binary files /dev/null and b/src/resources/trayicon.png differ