Initial commit...
BIN
Java Peojects/UDE/Images/1pane.png
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
Java Peojects/UDE/Images/2pane.png
Normal file
After Width: | Height: | Size: 348 KiB |
BIN
Java Peojects/UDE/Images/3pane.png
Normal file
After Width: | Height: | Size: 952 KiB |
BIN
Java Peojects/UDE/Images/4pane.png
Normal file
After Width: | Height: | Size: 721 KiB |
BIN
Java Peojects/UDE/Images/logic.png
Normal file
After Width: | Height: | Size: 160 KiB |
BIN
Java Peojects/UDE/Images/logic.xcf
Normal file
339
Java Peojects/UDE/LICENSE
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
||||
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.
|
||||
|
||||
{description}
|
||||
Copyright (C) {year} {fullname}
|
||||
|
||||
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.
|
||||
|
||||
{signature of Ty Coon}, 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.
|
28
Java Peojects/UDE/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# UDE
|
||||
UDE is a Java desktop environment that has both a file manager and desktop.
|
||||
<br/>
|
||||
<h2>Goals:</h2>
|
||||
<hr/>
|
||||
1. Make an easily customizable desktop environment.<br/>
|
||||
2. Allow for fancy effects.<br/>
|
||||
3. Mimic some of the old effects such as cube selection, grid wall selection, etc. <br/>
|
||||
4. Push the boundaries of what we consider a desktop. Try aiming for a 3D environment or just do something unique.
|
||||
<br/>
|
||||
<h2>Current Phase:</h2>
|
||||
<hr/>
|
||||
Fixing up directory structure and setting up for Jar creation. UFM completed and UDE needs it next.
|
||||
I might just use UFM's code to do the desktop than a separate Jar.
|
||||
<br/>
|
||||
<h2>Todo List:</h2>
|
||||
<hr/>
|
||||
2. Pretty much re-write everything.<br/>
|
||||
3. Focus on modularity.
|
||||
<br/>
|
||||
<h2>Images</h2>
|
||||
<hr/>
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
1
Java Peojects/UDE/UDE-Desktop/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
ude-desktop
|
13
Java Peojects/UDE/UDE-Desktop/.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="ude-desktop" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
</project>
|
6
Java Peojects/UDE/UDE-Desktop/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with NO BOM">
|
||||
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
14
Java Peojects/UDE/UDE-Desktop/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
181
Java Peojects/UDE/UDE-Desktop/.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,181 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="da49a23f-ac53-4385-bed0-813ee5f947a4" name="Default Changelist" comment="" />
|
||||
<ignored path="$PROJECT_DIR$/target/" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/CleanPath.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="255">
|
||||
<caret line="17" column="29" selection-start-line="17" selection-start-column="29" selection-end-line="17" selection-end-column="29" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/Thumbnail.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="240">
|
||||
<caret line="17" column="24" selection-start-line="17" selection-start-column="24" selection-end-line="17" selection-end-column="24" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/Settings.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="398">
|
||||
<caret line="37" column="76" selection-start-line="37" selection-start-column="76" selection-end-line="37" selection-end-column="76" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds" extendedState="6">
|
||||
<option name="y" value="32" />
|
||||
<option name="width" value="1920" />
|
||||
<option name="height" value="1016" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator proportions="" version="1">
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="PackagesPane" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="ude-desktop" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="UDE-Desktop" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="ude-desktop" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="UDE-Desktop" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="ude-desktop" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="UDE-Desktop" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="main" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="ude-desktop" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="UDE-Desktop" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="main" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="java" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1546130209215" />
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
<option name="ruleStates">
|
||||
<list>
|
||||
<RuleState>
|
||||
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
<RuleState>
|
||||
<option name="name" value="StatusDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration name="UDEDesktop" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<option name="MAIN_CLASS_NAME" value="UDEDesktop" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Application.UDEDesktop" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="da49a23f-ac53-4385-bed0-813ee5f947a4" name="Default Changelist" comment="" />
|
||||
<created>1546129975632</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1546129975632</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-2" y="31" width="1924" height="1019" extended-state="6" />
|
||||
<layout>
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.25239617" />
|
||||
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
||||
<window_info id="Image Layers" order="2" />
|
||||
<window_info id="Designer" order="3" />
|
||||
<window_info id="UI Designer" order="4" />
|
||||
<window_info id="Capture Tool" order="5" />
|
||||
<window_info id="Favorites" order="6" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<window_info anchor="bottom" id="Find" order="1" />
|
||||
<window_info anchor="bottom" id="Run" order="2" />
|
||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
|
||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||
<window_info anchor="bottom" id="TODO" order="6" />
|
||||
<window_info anchor="bottom" id="Terminal" order="7" />
|
||||
<window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Version Control" order="9" />
|
||||
<window_info anchor="bottom" id="Messages" order="10" />
|
||||
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
|
||||
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
||||
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
||||
<window_info anchor="right" id="Palette" order="3" />
|
||||
<window_info anchor="right" id="Maven" order="4" />
|
||||
<window_info anchor="right" id="Theme Preview" order="5" />
|
||||
<window_info anchor="right" id="Capture Analysis" order="6" />
|
||||
<window_info anchor="right" id="Palette	" order="7" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/CleanPath.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="255">
|
||||
<caret line="17" column="29" selection-start-line="17" selection-start-column="29" selection-end-line="17" selection-end-column="29" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/Thumbnail.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="240">
|
||||
<caret line="17" column="24" selection-start-line="17" selection-start-column="24" selection-end-line="17" selection-end-column="24" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/main/java/Settings.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="398">
|
||||
<caret line="37" column="76" selection-start-line="37" selection-start-column="76" selection-end-line="37" selection-end-column="76" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
17
Java Peojects/UDE/UDE-Desktop/README.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# UDE Desktop Environment
|
||||
|
||||
This is a mavenized version of UDE.
|
||||
|
||||
Compile:
|
||||
|
||||
```sh
|
||||
$ cd <project-dir>
|
||||
$ mvn clean install
|
||||
```
|
||||
|
||||
Run:
|
||||
|
||||
```sh
|
||||
$ cd <project-dir>
|
||||
$ java -jar target/ude-desktop.jar
|
||||
```
|
82
Java Peojects/UDE/UDE-Desktop/pom.xml
Normal file
@@ -0,0 +1,82 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.github</groupId>
|
||||
<artifactId>ude-desktop</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>UDE Desktop Environment</name>
|
||||
<description>UDE is a Java desktop environment that has both a file manager and desktop.</description>
|
||||
<url>https://github.com/maximstewart/UDE</url>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>GNU General Public License v2.0</name>
|
||||
<url>https://github.com/maximstewart/UDE/blob/master/LICENSE</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Maxim Stewart</name>
|
||||
<email>MaximStewart1@gmail.com</email>
|
||||
<id>maximstewart</id>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<issueManagement>
|
||||
<url>https://github.com/maximstewart/UDE/issues</url>
|
||||
<system>GitHub Issues</system>
|
||||
</issueManagement>
|
||||
|
||||
<scm>
|
||||
<connection>https://github.com/maximstewart/UDE.git</connection>
|
||||
<developerConnection>git@github.com:maximstewart/UDE.git</developerConnection>
|
||||
<url>https://github.com/maximstewart/UDE</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<version.maven-compiler-plugin>3.7.0</version.maven-compiler-plugin>
|
||||
<version.spring-boot-maven-plugin>2.0.4.RELEASE</version.spring-boot-maven-plugin>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<finalName>ude-desktop</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${version.maven-compiler-plugin}</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${version.spring-boot-maven-plugin}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!--<classifier>spring-boot</classifier>-->
|
||||
<mainClass>UDEDesktop</mainClass>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@@ -0,0 +1,40 @@
|
||||
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.scene.Scene;
|
||||
|
||||
public class BackgroundManager {
|
||||
|
||||
protected final Stage backgroundStage = new Stage();
|
||||
protected Scene scene;
|
||||
|
||||
// Private class to generate singleton
|
||||
private static BackgroundManager backgroundManager = new BackgroundManager();
|
||||
// init
|
||||
|
||||
private BackgroundManager() {
|
||||
// Setup window
|
||||
try {
|
||||
scene = new Scene(FXMLLoader.load(BackgroundManager.class.getResource("resources/BackgroundManagerWindow.fxml")), 800, 600);
|
||||
} catch (Exception e) {
|
||||
// If it fails, write the error message to screen
|
||||
e.printStackTrace();
|
||||
}
|
||||
backgroundStage.setScene(scene);
|
||||
backgroundStage.setTitle("Background");
|
||||
backgroundStage.setMinWidth(300);
|
||||
backgroundStage.setMinHeight(300);
|
||||
}
|
||||
|
||||
// Functions
|
||||
// Geters
|
||||
public static BackgroundManager getInstance() {
|
||||
return backgroundManager;
|
||||
}
|
||||
// Setters
|
||||
|
||||
// Others
|
||||
protected void showWindow() {
|
||||
backgroundStage.show();
|
||||
}
|
||||
}
|
@@ -0,0 +1,147 @@
|
||||
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.DirectoryChooser;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.TilePane;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.input.MouseButton;
|
||||
import java.io.File;
|
||||
import javafx.concurrent.Task;
|
||||
|
||||
public class BackgroundMngrController {
|
||||
// Class objects
|
||||
|
||||
private Settings settings = Settings.getInstance(); // Singleton Class settings
|
||||
|
||||
// Fxml objects
|
||||
@FXML
|
||||
private Label dir;
|
||||
@FXML
|
||||
private TextField txtDirPath;
|
||||
@FXML
|
||||
private Button clear;
|
||||
@FXML
|
||||
private TilePane tilePane;
|
||||
|
||||
// Generics
|
||||
private DirectoryChooser folderChooser = new DirectoryChooser();
|
||||
private Image pth = new Image(".");
|
||||
private Image previewPth = new Image(".");
|
||||
private ImageView imgView = new ImageView(pth);
|
||||
private String textAreaPth = "";
|
||||
private File directory;
|
||||
private File[] fileList;
|
||||
|
||||
@FXML
|
||||
void initialize() {
|
||||
// Initialize any logic here: all @FXML variables will have been injected
|
||||
}
|
||||
|
||||
@FXML
|
||||
void onEnter(KeyEvent event) {
|
||||
if (event.getCode().equals(KeyCode.ENTER)) {
|
||||
textAreaPth = txtDirPath.getText();
|
||||
System.out.println(textAreaPth);
|
||||
newDir();
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
void setNewDir(MouseEvent event) {
|
||||
newDir();
|
||||
}
|
||||
|
||||
// Scan selected dir
|
||||
public void newDir() {
|
||||
tilePane.getChildren().clear();
|
||||
Stage stage = new Stage();
|
||||
if (textAreaPth != "") {
|
||||
directory = new File(textAreaPth);
|
||||
} else {
|
||||
directory = folderChooser.showDialog(stage);
|
||||
if (directory != null) {
|
||||
System.out.println("Directory: " + directory);
|
||||
}
|
||||
}
|
||||
|
||||
fileList = directory.listFiles();
|
||||
txtDirPath.setText("" + directory);
|
||||
for (int i = 0; i < fileList.length; i++) {
|
||||
imgView = new ImageView();
|
||||
imgView.setFitWidth(300); // Need these here to get grid properly.
|
||||
imgView.setFitHeight(200);
|
||||
tilePane.getChildren().add(imgView);
|
||||
}
|
||||
|
||||
Task getDir = new Task<Void>() {
|
||||
@Override
|
||||
public Void call() {
|
||||
newDir2();
|
||||
return null;
|
||||
}
|
||||
};
|
||||
new Thread(getDir).start();
|
||||
}
|
||||
|
||||
public void newDir2() {
|
||||
int j = 0; // Used to properly insert to grid when there are files other than an image
|
||||
for (int i = 0; i < fileList.length; i++) {
|
||||
String path = "" + fileList[i];
|
||||
if (fileList[i].getName().contains(".png") || fileList[i].getName().contains(".jpg")
|
||||
|| fileList[i].getName().contains(".gif") || fileList[i].getName().contains(".jpeg")) {
|
||||
String title = "" + fileList[i];
|
||||
pth = new Image("file://" + fileList[i]);
|
||||
ImageView view = (ImageView) (tilePane.getChildren().get(j));
|
||||
|
||||
view.setImage(pth);
|
||||
view.setCache(true);
|
||||
final ImageView imgViewPoped = new ImageView("file://" + fileList[i]);
|
||||
// image click actions
|
||||
view.setOnMouseClicked(mouse -> {
|
||||
MouseButton button = mouse.getButton();
|
||||
if (mouse.getClickCount() == 2 && button == MouseButton.PRIMARY && !mouse.isConsumed()) {
|
||||
mouse.consume();
|
||||
txtDirPath.setText(path);
|
||||
settings.setBackgroundInfo(path);
|
||||
} else if (button == MouseButton.SECONDARY) {
|
||||
displayImg(imgViewPoped, title);
|
||||
}
|
||||
});
|
||||
j++;
|
||||
} else {
|
||||
System.out.println("Not an image file.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void displayImg(ImageView imgViewPoped, String title) {
|
||||
Stage popOut = new Stage();
|
||||
Pane pane = new Pane();
|
||||
imgViewPoped.setLayoutX(0);
|
||||
imgViewPoped.setLayoutY(0);
|
||||
imgViewPoped.fitWidthProperty().bind(pane.widthProperty());
|
||||
imgViewPoped.fitHeightProperty().bind(pane.heightProperty());
|
||||
pane.getChildren().add(imgViewPoped);
|
||||
Scene scene = new Scene(pane, 1280, 900);
|
||||
popOut.setTitle(title);
|
||||
popOut.setScene(scene);
|
||||
popOut.show();
|
||||
}
|
||||
|
||||
@FXML
|
||||
void clearBttnClick(ActionEvent event) {
|
||||
tilePane.getChildren().clear();
|
||||
tilePane.getChildren().addAll(dir);
|
||||
txtDirPath.setText("");
|
||||
}
|
||||
}
|
29
Java Peojects/UDE/UDE-Desktop/src/main/java/CleanPath.java
Normal file
@@ -0,0 +1,29 @@
|
||||
// Clear file of special characters and spaces
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class CleanPath {
|
||||
|
||||
private String preLine = "";
|
||||
|
||||
public String cleanThumbPth(String tmp) {
|
||||
File f = new File(tmp);
|
||||
|
||||
// if it's a directory, don't remove the extention
|
||||
if (f.isDirectory()) {
|
||||
System.out.println("This is a a directory.");
|
||||
}
|
||||
String name = f.getName();
|
||||
final int lastPeriodPos = name.lastIndexOf('.');
|
||||
if (lastPeriodPos <= 0) {
|
||||
preLine = "" + name;
|
||||
} else {
|
||||
// Remove the last period and everything after it
|
||||
File renamed = new File(f.getParent(), name.substring(0, lastPeriodPos));
|
||||
preLine = "" + renamed;
|
||||
preLine = preLine.replaceAll("[^A-Za-z]+", "");
|
||||
preLine = preLine.replaceAll("\\s+", "");
|
||||
}
|
||||
return preLine;
|
||||
}
|
||||
}
|
85
Java Peojects/UDE/UDE-Desktop/src/main/java/Controller.java
Normal file
@@ -0,0 +1,85 @@
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.control.ContextMenu;
|
||||
import javafx.scene.input.ContextMenuEvent;
|
||||
import javafx.scene.control.MenuItem;
|
||||
import javafx.event.EventHandler;
|
||||
|
||||
public class Controller {
|
||||
// Class objects
|
||||
|
||||
private Settings settings = Settings.getInstance(); // Singleton Class settings
|
||||
|
||||
// Fxml objects
|
||||
@FXML private AnchorPane desktopArea;
|
||||
@FXML private ImageView backgroundImgView;
|
||||
|
||||
// Generics
|
||||
private int x = 0, y = 0, found = 0; // x & y for grid generation
|
||||
private boolean isMain = false;
|
||||
private ContextMenu contextMenu = new ContextMenu();
|
||||
final private MenuItem settingsMenuItm = new MenuItem("Settings"),
|
||||
chngBckgrndMenuItem = new MenuItem("Desktop Background");
|
||||
|
||||
public Controller(boolean isMain) {
|
||||
this.isMain = isMain;
|
||||
}
|
||||
|
||||
@FXML void initialize() {
|
||||
// Create ContextMenu
|
||||
settingsMenuItm.setOnAction(e -> {
|
||||
settings.showWindow();
|
||||
});
|
||||
chngBckgrndMenuItem.setOnAction(e -> {
|
||||
settings.callBackgroundMngr();
|
||||
});
|
||||
|
||||
// Add MenuItem to ContextMenu
|
||||
contextMenu.getItems().addAll(settingsMenuItm, chngBckgrndMenuItem);
|
||||
|
||||
// When user right-click on desktop
|
||||
desktopArea.setOnContextMenuRequested(new EventHandler<ContextMenuEvent>() {
|
||||
@Override
|
||||
public void handle(ContextMenuEvent event) {
|
||||
contextMenu.show(desktopArea, event.getScreenX(), event.getScreenY());
|
||||
}
|
||||
});
|
||||
|
||||
settings.setsettingsImgView(backgroundImgView);
|
||||
// backgroundImgView.setImage(settings.getBackgroundInfo());
|
||||
backgroundImgView.setFitWidth(1920); // Scale to view Note: need to do based on system parameters
|
||||
backgroundImgView.setFitHeight(1080);
|
||||
|
||||
if (isMain) {
|
||||
addIconTiles();
|
||||
}
|
||||
}
|
||||
|
||||
// set icons to desktop view
|
||||
// Possibly too many calls....
|
||||
void addIconTiles() {
|
||||
if (settings.getDesktopItems() != null) {
|
||||
for (int i = 0; i < settings.getDesktopItems().length; i++) {
|
||||
Icon icon = new Icon();
|
||||
final String fileName = "" + settings.getDesktopItems()[i].getName(),
|
||||
file = "" + settings.getDesktopItems()[i];
|
||||
|
||||
// Create Icon and position icon on grid according to parameters
|
||||
// passes desktop, path, name, index, and x and y coridinits
|
||||
icon.createIcon(desktopArea, file, fileName, i, x, y);
|
||||
desktopArea.getChildren().add(icon.getIcon());
|
||||
desktopArea.setLeftAnchor(icon.getIcon(), (double) x);
|
||||
desktopArea.setTopAnchor(icon.getIcon(), (double) y);
|
||||
|
||||
// Grid management
|
||||
x += 160;
|
||||
if (x >= 1600) {
|
||||
x = 0;
|
||||
y += 150;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
138
Java Peojects/UDE/UDE-Desktop/src/main/java/Icon.java
Normal file
@@ -0,0 +1,138 @@
|
||||
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Tooltip;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import java.util.Scanner;
|
||||
import java.io.File;
|
||||
|
||||
public class Icon {
|
||||
// Class objects
|
||||
|
||||
private Thumbnail thumbnail = new Thumbnail();
|
||||
|
||||
// Generics
|
||||
private VBox icon = new VBox();
|
||||
private Image img;
|
||||
private ImageView imgView = new ImageView();
|
||||
private Label title = new Label("");
|
||||
private Tooltip tooltip;
|
||||
private Process pb; // Process runner
|
||||
private Scanner scanner;
|
||||
private File file;
|
||||
|
||||
private String containsStr = System.getProperty("user.home") + "/Desktop/",
|
||||
toLaunch = "", runCommand = "", thumbImg = "",
|
||||
toShellOut = "", toShellExec = "", line = "",
|
||||
path = "", name = "";
|
||||
private double orgSceneX, orgSceneY, orgTranslateX, orgTranslateY;
|
||||
private double iconWidth = 150.0, iconHeight = 100.0;
|
||||
|
||||
public VBox getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void createIcon(AnchorPane desktopArea, String pth, String nme,
|
||||
int i, int x, int y) {
|
||||
icon.getStyleClass().add("vbox");
|
||||
path = pth;
|
||||
name = nme;
|
||||
|
||||
// Creates Icon parts for desktop and sets click actions
|
||||
getIconImg();
|
||||
mergeIconParts();
|
||||
setExecuteModel();
|
||||
setIconEvents(desktopArea);
|
||||
}
|
||||
|
||||
private void getIconImg() {
|
||||
thumbnail.setIconImg(path, name);
|
||||
thumbImg = thumbnail.getIconImg();
|
||||
System.out.println("b4 insert " + thumbImg);
|
||||
|
||||
img = new Image("file:" + thumbImg);
|
||||
imgView.setImage(img);
|
||||
imgView.setFitWidth(iconWidth); // Need these here to get grid properly.
|
||||
imgView.setFitHeight(iconHeight);
|
||||
imgView.setCache(true); // Improves responsiveness when there are many images
|
||||
}
|
||||
|
||||
private void mergeIconParts() {
|
||||
title.setMaxWidth(iconWidth); // Based On Character Count??
|
||||
title.setText(name);
|
||||
tooltip = new Tooltip(name);
|
||||
tooltip.minHeight(800);
|
||||
tooltip.minWidth(800);
|
||||
Tooltip.install(icon, tooltip);
|
||||
icon.getChildren().addAll(imgView, title); // Insert image and name to icon VBox container
|
||||
}
|
||||
|
||||
private void setExecuteModel() {
|
||||
// Set file execution for .desktop files else use xdg-open
|
||||
toLaunch = path;
|
||||
if (path.contains(".desktop")) {
|
||||
file = new File(path);
|
||||
try {
|
||||
scanner = new Scanner(file);
|
||||
while (scanner.hasNext()) {
|
||||
line = scanner.nextLine();
|
||||
if (line.contains("Exec=")) {
|
||||
toShellOut = line;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Throwable lineErr) {
|
||||
System.out.println("Failed To Get Exec Info: " + lineErr);
|
||||
}
|
||||
|
||||
if (toShellOut.contains("TryExec=")) {
|
||||
toShellOut = toShellOut.replaceAll("TryExec=", "");
|
||||
} else if (toShellOut.contains("Exec=")) {
|
||||
toShellOut = toShellOut.replaceAll("Exec=", "");
|
||||
}
|
||||
runCommand = toShellOut;
|
||||
} else {
|
||||
runCommand = "xdg-open " + toLaunch;
|
||||
}
|
||||
}
|
||||
|
||||
private void setIconEvents(AnchorPane desktopArea) {
|
||||
icon.addEventFilter(MouseEvent.MOUSE_PRESSED,
|
||||
new EventHandler<MouseEvent>() {
|
||||
@Override
|
||||
public void handle(MouseEvent click) {
|
||||
if (click.getClickCount() == 2) {
|
||||
click.consume();
|
||||
try {
|
||||
System.out.println(runCommand);
|
||||
pb = Runtime.getRuntime().exec(runCommand);
|
||||
} catch (Throwable imgIOErr) {
|
||||
System.out.println(imgIOErr);
|
||||
}
|
||||
} else {
|
||||
orgSceneX = click.getSceneX();
|
||||
orgSceneY = click.getSceneY();
|
||||
orgTranslateX = desktopArea.getLeftAnchor(icon);
|
||||
orgTranslateY = desktopArea.getTopAnchor(icon);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
icon.addEventFilter(MouseEvent.MOUSE_DRAGGED,
|
||||
new EventHandler<MouseEvent>() {
|
||||
@Override
|
||||
public void handle(MouseEvent clck) {
|
||||
double offsetX = clck.getSceneX() - orgSceneX;
|
||||
double offsetY = clck.getSceneY() - orgSceneY;
|
||||
double newTranslateX = orgTranslateX + offsetX;
|
||||
double newTranslateY = orgTranslateY + offsetY;
|
||||
desktopArea.setLeftAnchor(icon, newTranslateX);
|
||||
desktopArea.setTopAnchor(icon, newTranslateY);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
136
Java Peojects/UDE/UDE-Desktop/src/main/java/Settings.java
Normal file
@@ -0,0 +1,136 @@
|
||||
// :: NOTES ::
|
||||
// Read file for Icon= to get the desktop's icon. Then look for it in:
|
||||
// Steam --> ~/.local/share/icons/hicolor/256x256/apps/.
|
||||
// --> ~/.local/share/applications/
|
||||
// Other Icons --> /usr/share/icons/<themeName>/<size>
|
||||
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import java.io.File;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Settings {
|
||||
// Class objects
|
||||
|
||||
protected final Stage settingsStage = new Stage();
|
||||
private BackgroundManager backgroundManager = BackgroundManager.getInstance(); // Singleton Class backgroundManager
|
||||
|
||||
// Generics
|
||||
protected Scene scene;
|
||||
private File thumbDirPth = new File("thumbs/"),
|
||||
desktopDir = new File(System.getProperty("user.home") + "/Desktop/"),
|
||||
highColorDir = new File(System.getProperty("user.home")
|
||||
+ "/.local/share/icons/hicolor/256x256/apps/"),
|
||||
localApplicationsDir = new File(System.getProperty("user.home")
|
||||
+ "/.local/share/applications/");
|
||||
private File[] desktopItems = desktopDir.listFiles(), // Gets files in desktop folder
|
||||
thumbsList = thumbDirPth.listFiles(), // Gets video thumbnail list
|
||||
highColorDirList = highColorDir.listFiles(),
|
||||
localApplicationsDirList = localApplicationsDir.listFiles();
|
||||
|
||||
private String imgPath, line, defaultBG = "resources/generic-theme/background.png";
|
||||
private Image backgroundImg;
|
||||
private ImageView bgView;
|
||||
private Scanner scanner;
|
||||
private File file = new File(System.getProperty("user.home") + "/ude-config.txt");
|
||||
|
||||
// Private class to generate singleton
|
||||
private static Settings settings = new Settings();
|
||||
// init
|
||||
|
||||
private Settings() {
|
||||
// Setup window
|
||||
try {
|
||||
scene = new Scene(FXMLLoader.load(Settings.class.getResource("resources/SettingsManagerWindow.fxml")), 800, 600);
|
||||
} catch (Exception e) {
|
||||
// If it fails, write the error message to screen
|
||||
e.printStackTrace();
|
||||
}
|
||||
settingsStage.setScene(scene);
|
||||
settingsStage.setTitle("Settings");
|
||||
settingsStage.setMinWidth(300);
|
||||
settingsStage.setMinHeight(300);
|
||||
|
||||
// load settings info from file by reading line by line
|
||||
if (file.exists()) {
|
||||
try {
|
||||
scanner = new Scanner(file);
|
||||
while (scanner.hasNext()) {
|
||||
line = scanner.nextLine();
|
||||
if (line.contains("Background=")) {
|
||||
line = line.replaceAll("Background=", "");
|
||||
if (line.isEmpty()) {
|
||||
backgroundImg = new Image(defaultBG);
|
||||
} else {
|
||||
backgroundImg = new Image("file://" + line);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable lineErr) {
|
||||
backgroundImg = new Image(defaultBG);
|
||||
System.out.println("Failed To Get Config Info: " + lineErr);
|
||||
}
|
||||
} else {
|
||||
backgroundImg = new Image(defaultBG);
|
||||
System.out.println("Config file does not exist.");
|
||||
}
|
||||
}
|
||||
// Functions
|
||||
// Geters
|
||||
|
||||
public static Settings getInstance() {
|
||||
return settings;
|
||||
}
|
||||
|
||||
protected Image getBackgroundInfo() {
|
||||
return backgroundImg;
|
||||
}
|
||||
|
||||
protected String getImgPath() {
|
||||
return imgPath;
|
||||
}
|
||||
|
||||
protected File getThumbDirPth() {
|
||||
return thumbDirPth;
|
||||
}
|
||||
|
||||
protected File[] getDesktopItems() {
|
||||
return desktopItems;
|
||||
}
|
||||
|
||||
protected File[] getThumbsList() {
|
||||
return thumbsList;
|
||||
}
|
||||
|
||||
protected File[] getHighColorDirList() {
|
||||
return highColorDirList;
|
||||
}
|
||||
|
||||
protected File[] getLocalApplicationsDirList() {
|
||||
return localApplicationsDirList;
|
||||
}
|
||||
|
||||
// Setters
|
||||
protected void setsettingsImgView(ImageView imgVw) {
|
||||
bgView = imgVw;
|
||||
}
|
||||
|
||||
protected void setBackgroundInfo(String file) {
|
||||
imgPath = file;
|
||||
bgView.setImage(new Image("file://" + file));
|
||||
}
|
||||
|
||||
// Others
|
||||
protected void callBackgroundMngr() {
|
||||
showWindow();
|
||||
backgroundManager.showWindow();
|
||||
}
|
||||
|
||||
protected void showWindow() {
|
||||
settingsStage.show();
|
||||
}
|
||||
}
|
75
Java Peojects/UDE/UDE-Desktop/src/main/java/Thumbnail.java
Normal file
@@ -0,0 +1,75 @@
|
||||
// Generates the actual image of the icon.
|
||||
|
||||
import java.util.Scanner;
|
||||
import java.io.File;
|
||||
|
||||
public class Thumbnail {
|
||||
// Class objects
|
||||
|
||||
private Settings settings = Settings.getInstance(); // Singleton Class
|
||||
private CleanPath cleaner = new CleanPath(); // Cleans thumbnail names
|
||||
private ThumbnailGenerator vidThumbnailGen = new ThumbnailGenerator();
|
||||
|
||||
// Generics
|
||||
private Scanner scanner;
|
||||
private File file;
|
||||
private String thumbImg = "", line = "", temp = "";
|
||||
|
||||
public String getIconImg() {
|
||||
return thumbImg;
|
||||
}
|
||||
|
||||
public void setIconImg(String path, String name) {
|
||||
File[] highColorDirList = settings.getHighColorDirList();
|
||||
File[] localApplicationsDirList = settings.getLocalApplicationsDirList();
|
||||
temp = path.toLowerCase();
|
||||
|
||||
if (temp.matches("^.*?(avi|webm|mpeg|mpg|mkv|flv|wmv|mp4).*$")) {
|
||||
thumbImg = vidThumbnailGen.generateThumb(path, cleaner.cleanThumbPth(name));
|
||||
} else if (temp.matches("^.*?(png|svg|jpg|jpeg|tiff).*$")) {
|
||||
thumbImg = path;
|
||||
} else if (temp.contains(".desktop")) {
|
||||
file = new File(path);
|
||||
try {
|
||||
scanner = new Scanner(file);
|
||||
while (scanner.hasNext()) {
|
||||
line = scanner.nextLine();
|
||||
if (line.contains("Icon=")) {
|
||||
thumbImg = line;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Throwable lineErr) {
|
||||
System.out.println("Failed To Get Icon: " + lineErr);
|
||||
}
|
||||
thumbImg = thumbImg.replaceAll("Icon=", ""); // Strip Icon= from the icon info
|
||||
|
||||
// Steam Icons
|
||||
if (thumbImg.contains("steam_icon")) {
|
||||
for (int i = 0; i < highColorDirList.length; i++) {
|
||||
if (highColorDirList[i].toString().contains(thumbImg)) {
|
||||
thumbImg = "" + highColorDirList[i];
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < localApplicationsDirList.length; i++) {
|
||||
if (localApplicationsDirList[i].toString().contains(thumbImg)) {
|
||||
thumbImg = "" + localApplicationsDirList[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// use getGenericIcon.py to get generic icon
|
||||
// String command = "python getGenericIcon.py " + path, shellOut = "";
|
||||
// try {
|
||||
// scanner = new Scanner(Runtime.getRuntime().exec(command).getInputStream()).useDelimiter("\\A");
|
||||
// shellOut = (scanner.hasNext()) ? scanner.next() : "";
|
||||
// scanner = new Scanner(Runtime.getRuntime().exec("readlink -f " + shellOut).getInputStream()).useDelimiter("\\A");
|
||||
// shellOut = (scanner.hasNext()) ? scanner.next() : "t";
|
||||
// } catch (Throwable e) {
|
||||
// System.out.println("Exception Caught In Thumbnail.\n" + e);
|
||||
// }
|
||||
// thumbImg = shellOut;
|
||||
thumbImg = "generic-theme/genericfile.png";
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
// Generate Thumbnails for videos with ffmpegthumbnailer
|
||||
|
||||
public class ThumbnailGenerator {
|
||||
|
||||
private Process pb; // Process runner
|
||||
private String thumbName, genCommand;
|
||||
|
||||
public String generateThumb(String file, String thumb) {
|
||||
thumbName = thumb;
|
||||
genCommand = "ffmpegthumbnailer -w -t='00:30:00' -c png -i "
|
||||
+ file + " -s 300 -o " + "thumbs/" + thumbName + ".png";
|
||||
try {
|
||||
pb = Runtime.getRuntime().exec(genCommand);
|
||||
pb.waitFor();
|
||||
} catch (Throwable imgIOErr) {
|
||||
System.out.println(imgIOErr);
|
||||
}
|
||||
thumbName = "./thumbs/" + thumbName + ".png";
|
||||
return thumbName;
|
||||
}
|
||||
}
|
63
Java Peojects/UDE/UDE-Desktop/src/main/java/UDEDesktop.java
Normal file
@@ -0,0 +1,63 @@
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import java.awt.GraphicsDevice;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.StageStyle;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.Parent;
|
||||
|
||||
|
||||
public class UDEDesktop extends Application {
|
||||
// Classes
|
||||
|
||||
// Generics
|
||||
private static final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
private static final GraphicsDevice[] screens = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
|
||||
private static boolean isMain = true;
|
||||
|
||||
@Override public void start(final Stage stg) throws Exception {
|
||||
for (int i=0; i<screens.length; i++) {
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("resources/UDEDesktopWindow.fxml"));
|
||||
Controller ctrllr = new Controller(isMain);
|
||||
loader.setController(ctrllr);
|
||||
Parent root = loader.load();
|
||||
Stage stage = new Stage();
|
||||
double width = (double) screens[i].getDisplayMode().getWidth();
|
||||
double height = (double) screens[i].getDisplayMode().getHeight();
|
||||
Scene scene = new Scene(root, width, height);
|
||||
scene.getStylesheets().add("resources/stylesheet.css");
|
||||
scene.setFill(null);
|
||||
// AnchorPane ap = new AnchorPane();
|
||||
// ap.setMinSize(width, height);
|
||||
// stage.initStyle(StageStyle.TRANSPARENT);
|
||||
stage.initStyle(StageStyle.UNDECORATED);
|
||||
stage.setScene(scene);
|
||||
stage.show();
|
||||
// stage.setX(screens[i].getDisplayMode().getX());
|
||||
// stage.setY(screens[i].getDisplayMode().getY());
|
||||
stage.toBack();
|
||||
isMain = false;
|
||||
}
|
||||
|
||||
|
||||
// int width = screens[0].getDisplayMode().getWidth();
|
||||
// int height = screens[0].getDisplayMode().getHeight();
|
||||
// Controller ctrl = new Controller();
|
||||
// FXMLLoader loader = new FXMLLoader(UDEDesktop.class.getResource("UDEDesktopWindow.fxml"))
|
||||
// loader.setController(mc);
|
||||
//
|
||||
// Scene scene = new Scene(, width, height);
|
||||
// scene.setFill(null);
|
||||
// scene.getStylesheets().add("stylesheet.css");
|
||||
// stage.setScene(scene);
|
||||
// stage.initStyle(StageStyle.UNDECORATED);
|
||||
// stage.setTitle("UDEDesktop");
|
||||
// stage.show();
|
||||
// stage.toBack();
|
||||
}
|
||||
|
||||
// needed because you know... it's java.
|
||||
public static void main(String[] args) { launch(args); }
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.TilePane?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
<?scenebuilder-background-color 0x444444ff?>
|
||||
|
||||
<AnchorPane minHeight="300.0" minWidth="300.0" prefHeight="600.0" prefWidth="950.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="BackgroundMngrController">
|
||||
<children>
|
||||
<HBox alignment="TOP_RIGHT" layoutY="0.0" prefHeight="21.0" prefWidth="948.0" AnchorPane.leftAnchor="1.0" AnchorPane.rightAnchor="1.0">
|
||||
<children>
|
||||
<TextField fx:id="txtDirPath" blendMode="DIFFERENCE" onKeyReleased="#onEnter" prefWidth="200.0" promptText="Dir Path" HBox.hgrow="ALWAYS" />
|
||||
<Button fx:id="clear" mnemonicParsing="false" onAction="#clearBttnClick" text="Clear" />
|
||||
</children>
|
||||
</HBox>
|
||||
<ScrollPane id="ScrollPane" minHeight="300.0" minWidth="300.0" prefHeight="547.0" prefViewportHeight="534.0" prefViewportWidth="742.0" prefWidth="770.0" style=" -fx-fit-to-height: true; -fx-fit-to-width: true;" AnchorPane.bottomAnchor="-2.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="25.0">
|
||||
<content>
|
||||
<TilePane fx:id="tilePane" hgap="15.0" prefHeight="532.0" prefWidth="755.0" vgap="15.0">
|
||||
<children>
|
||||
<Label fx:id="dir" contentDisplay="CENTER" labelFor="$clear" onMouseClicked="#setNewDir" prefHeight="575.0" prefWidth="948.0" text="Choose Dir" textAlignment="LEFT" textFill="#dfdfdf" textOverrun="CLIP" underline="false" wrapText="false" TilePane.alignment="CENTER_LEFT">
|
||||
<font>
|
||||
<Font name="System Bold" size="32.0" />
|
||||
</font>
|
||||
<TilePane.margin>
|
||||
<Insets />
|
||||
</TilePane.margin>
|
||||
</Label>
|
||||
</children>
|
||||
</TilePane>
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</AnchorPane>
|
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.CheckBox?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?scenebuilder-background-color 0x444444ff?>
|
||||
|
||||
<AnchorPane fx:id="desktopArea" minHeight="300.0" minWidth="300.0" prefHeight="600.0" prefWidth="950.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<CheckBox fx:id="toGridOrNaw" layoutX="85.0" layoutY="558.0" mnemonicParsing="false" text="Gridded View or Free Form View" />
|
||||
</children>
|
||||
</AnchorPane>
|
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Rectangle2D?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?scenebuilder-background-color 0x444444ff?>
|
||||
|
||||
<AnchorPane fx:id="desktopArea" minHeight="300.0" minWidth="300.0" prefHeight="600.0" prefWidth="950.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<ImageView fx:id="backgroundImgView" fitHeight="600.0" fitWidth="950.0" mouseTransparent="true" pickOnBounds="true" preserveRatio="true" x="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<viewport>
|
||||
<Rectangle2D />
|
||||
</viewport>
|
||||
</ImageView>
|
||||
</children>
|
||||
</AnchorPane>
|
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 22 KiB |
@@ -0,0 +1,14 @@
|
||||
.root {
|
||||
/*-fx-background: rgba(68, 68, 68, 0.8); // == #444444;*/
|
||||
-fx-background: rgba(0, 0, 0, 0.0);
|
||||
}
|
||||
.button {
|
||||
}
|
||||
|
||||
.vbox {
|
||||
-fx-background-color: rgba(68, 68, 68, .5);
|
||||
}
|
||||
|
||||
.vbox:hover {
|
||||
-fx-background-color: rgba(68, 68, 68, 1)s
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
Background=
|
||||
/home/abaddon/LazyShare/Pictures/Background/Budah.jpg
|
11
Java Peojects/UDE/UFM/buildJar.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
function main() {
|
||||
jar cvfm UFM.jar manifest.txt com/itdominator/ufm/*.class \
|
||||
com/itdominator/ufm/TabSystem \
|
||||
com/itdominator/ufm/ThumbnailSystem \
|
||||
com/itdominator/ufm/Utils \
|
||||
com/itdominator/ufm/resources
|
||||
chmod +x UFM.jar
|
||||
}
|
||||
main;
|
BIN
Java Peojects/UDE/UFM/com/itdominator/ufm/Controller$1.class
Normal file
BIN
Java Peojects/UDE/UFM/com/itdominator/ufm/Controller.class
Normal file
BIN
Java Peojects/UDE/UFM/com/itdominator/ufm/TabSystem/Icon$1.class
Normal file
BIN
Java Peojects/UDE/UFM/com/itdominator/ufm/TabSystem/Icon.class
Normal file
BIN
Java Peojects/UDE/UFM/com/itdominator/ufm/UFM.class
Normal file
BIN
Java Peojects/UDE/UFM/com/itdominator/ufm/Utils/Settings.class
Normal file
BIN
Java Peojects/UDE/UFM/com/itdominator/ufm/Utils/UFMLogger.class
Normal file
BIN
Java Peojects/UDE/UFM/com/itdominator/ufm/resources/UFM.png
Normal file
After Width: | Height: | Size: 860 B |
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.ButtonBar?>
|
||||
<?import javafx.scene.control.Menu?>
|
||||
<?import javafx.scene.control.MenuBar?>
|
||||
<?import javafx.scene.control.MenuItem?>
|
||||
<?import javafx.scene.control.Separator?>
|
||||
<?import javafx.scene.control.SplitPane?>
|
||||
<?import javafx.scene.control.TabPane?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
|
||||
<AnchorPane fx:id="masterBase" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="600.0" minWidth="800.0" prefHeight="720.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<HBox fx:id="masterMenu" prefHeight="25.0" prefWidth="800.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<children>
|
||||
<MenuBar prefHeight="40.0" prefWidth="184.0" HBox.hgrow="SOMETIMES">
|
||||
<menus>
|
||||
<Menu mnemonicParsing="false" text="File">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Close" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="View">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Action 1" />
|
||||
</items>
|
||||
</Menu>
|
||||
<Menu mnemonicParsing="false" text="Help">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="About" />
|
||||
</items>
|
||||
</Menu>
|
||||
</menus>
|
||||
</MenuBar>
|
||||
<Separator opacity="0.0" prefHeight="40.0" HBox.hgrow="ALWAYS" />
|
||||
<ButtonBar prefHeight="40.0" prefWidth="440.0">
|
||||
<buttons>
|
||||
<Button mnemonicParsing="false" styleClass="toggle-button" />
|
||||
<Button fx:id="tgglPane2Bttn" mnemonicParsing="false" styleClass="toggle-button" />
|
||||
<Button fx:id="tgglPane3Bttn" mnemonicParsing="false" styleClass="toggle-button" />
|
||||
<Button fx:id="tgglPane4Bttn" mnemonicParsing="false" styleClass="toggle-button" />
|
||||
</buttons>
|
||||
</ButtonBar>
|
||||
<Separator maxWidth="20.0" minWidth="20.0" opacity="0.0" prefHeight="40.0" prefWidth="20.0" />
|
||||
</children>
|
||||
</HBox>
|
||||
<SplitPane fx:id="masterSplitPane" dividerPositions="0.5" layoutX="14.0" layoutY="40.0" orientation="VERTICAL" prefHeight="559.0" prefWidth="800.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="30.0">
|
||||
<items>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="100.0" prefWidth="160.0">
|
||||
<children>
|
||||
<SplitPane fx:id="splitPaneTop" dividerPositions="0.5" prefHeight="275.0" prefWidth="628.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<items>
|
||||
<AnchorPane fx:id="base1" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
|
||||
<children>
|
||||
<TabPane fx:id="tabPane1" layoutY="14.0" onDragDone="#openLocation" onMouseClicked="#newTab" onMouseEntered="#setSelectedTo1" prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="ALL_TABS" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane fx:id="base2" minHeight="0.0" minWidth="0.0" prefHeight="273.0" prefWidth="588.0">
|
||||
<children>
|
||||
<TabPane fx:id="tabPane2" layoutX="14.0" layoutY="14.0" onDragDone="#openLocation" onMouseClicked="#newTab" onMouseEntered="#setSelectedTo2" prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="ALL_TABS" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</items>
|
||||
</SplitPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane fx:id="splitPaneBottomAnchor" minHeight="0.0" minWidth="0.0" prefHeight="100.0" prefWidth="160.0">
|
||||
<children>
|
||||
<SplitPane fx:id="splitPaneBottom" dividerPositions="0.5" prefHeight="275.0" prefWidth="798.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<items>
|
||||
<AnchorPane fx:id="base3" minHeight="0.0" minWidth="0.0" prefHeight="273.0" prefWidth="463.0">
|
||||
<children>
|
||||
<TabPane fx:id="tabPane3" layoutX="-1.0" onDragDone="#openLocation" onMouseClicked="#newTab" onMouseEntered="#setSelectedTo3" prefHeight="275.0" prefWidth="394.0" tabClosingPolicy="ALL_TABS" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="-1.0" AnchorPane.rightAnchor="1.0" AnchorPane.topAnchor="0.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
<AnchorPane fx:id="base4" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
|
||||
<children>
|
||||
<TabPane fx:id="tabPane4" onDragDone="#openLocation" onMouseClicked="#newTab" onMouseEntered="#setSelectedTo4" prefHeight="200.0" prefWidth="200.0" tabClosingPolicy="ALL_TABS" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</items>
|
||||
</SplitPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</items>
|
||||
</SplitPane>
|
||||
</children>
|
||||
</AnchorPane>
|
BIN
Java Peojects/UDE/UFM/com/itdominator/ufm/resources/backgrounds/grit.jpg
Executable file
After Width: | Height: | Size: 177 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 858 B |
After Width: | Height: | Size: 850 B |
After Width: | Height: | Size: 702 B |
After Width: | Height: | Size: 925 B |
After Width: | Height: | Size: 882 B |
After Width: | Height: | Size: 707 B |
After Width: | Height: | Size: 798 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,75 @@
|
||||
.root {
|
||||
-fx-background: rgba(0,0,0,0.65);
|
||||
}
|
||||
|
||||
/* Pane Toggle Buttons */
|
||||
.toggle-button {
|
||||
-fx-background-radius: 5em;
|
||||
-fx-min-width: 2em;
|
||||
-fx-min-height: 2em;
|
||||
-fx-max-width: 2em;
|
||||
-fx-max-height: 2em;
|
||||
-fx-background-color: #008800;
|
||||
}
|
||||
|
||||
.toggle-button:hover {
|
||||
-fx-cursor: hand;
|
||||
}
|
||||
|
||||
/* File path field */
|
||||
.fileURLField {
|
||||
-fx-background-color: rgba(0, 0, 0, 0.65);
|
||||
-fx-text-fill: rgba(255, 255, 255, 1);
|
||||
-fx-border-color: rgba(40,191,224,1);
|
||||
-fx-border-style: solid;
|
||||
}
|
||||
|
||||
.fileURLField:focused {
|
||||
-fx-border-color: rgba(51,215,37,1);
|
||||
-fx-border-style: solid;
|
||||
}
|
||||
|
||||
/* Icon view area */
|
||||
.tile-pane {
|
||||
-fx-pref-columns: 100;
|
||||
-fx-hgap: 0.5em;
|
||||
-fx-vgap: 0.5em;
|
||||
-fx-background-color: rgba(3,0,0,.65); // == #444444;
|
||||
-fx-background-image: url("./backgrounds/grit.jpg");
|
||||
-fx-border-image-repeat: stretch;
|
||||
-fx-background-size: cover, auto;
|
||||
/*-fx-border-image-width: 100%, 100%;*/
|
||||
/*-fx-background-position: left top, center;*/
|
||||
/*-fx-tile-alignment: center;*/
|
||||
}
|
||||
|
||||
/* Icon types */
|
||||
.icon-folder, .icon-bin, .icon-compressed, .icon-document,
|
||||
.icon-presentation, .icon-spreadsheet, .icon-pdf, .icon-web,
|
||||
.icon-file, .icon-video, .icon-music, .icon-text {
|
||||
-fx-min-width: 64px;
|
||||
-fx-min-height: 64px;
|
||||
-fx-width: 64px;
|
||||
-fx-height: 64px;
|
||||
-fx-max-width: 150px;
|
||||
-fx-max-height: 150px;
|
||||
-fx-background-color: rgba(68, 68, 68, .4);
|
||||
-fx-background-size: 64px 64px;
|
||||
}
|
||||
|
||||
.icon:hover {
|
||||
-fx-background-color: rgba(68, 68, 68, 1);
|
||||
}
|
||||
|
||||
.icon-folder { -fx-image: url("icons/dir.png"); }
|
||||
.icon-bin { -fx-image: url("icons/bin.png"); }
|
||||
.icon-compressed { -fx-image: url("icons/archive.png"); }
|
||||
.icon-document { -fx-image: url("icons/doc.png"); }
|
||||
.icon-presentation { -fx-image: url("icons/presentation.png"); }
|
||||
.icon-spreadsheet { -fx-image: url("icons/spreadsheet.png"); }
|
||||
.icon-pdf { -fx-image: url("icons/pdf.png"); }
|
||||
.icon-web { -fx-image: url("icons/web.png"); }
|
||||
.icon-file { -fx-image: url("system-items/systemFile.png"); }
|
||||
.icon-video { -fx-image: url("icons/video.png"); }
|
||||
.icon-music { -fx-image: url("icons/audio.png"); }
|
||||
.icon-text { -fx-image: url("icons/text.png"); }
|
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 22 KiB |
1
Java Peojects/UDE/UFM/manifest.txt
Normal file
@@ -0,0 +1 @@
|
||||
Main-Class: com.itdominator.ufm.UFM
|
199
Java Peojects/UDE/UFM/src/Controller.java
Normal file
@@ -0,0 +1,199 @@
|
||||
package com.itdominator.ufm;
|
||||
|
||||
import com.itdominator.ufm.Utils.Settings;
|
||||
import com.itdominator.ufm.TabSystem.TabView;
|
||||
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.TabPane;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.control.TabPane;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.SplitPane;
|
||||
|
||||
import javafx.scene.input.DragEvent;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import javafx.scene.Node;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
|
||||
public class Controller {
|
||||
// Classes
|
||||
private Settings settings = Settings.getInstance();
|
||||
|
||||
// FXML stuff
|
||||
@FXML private HBox masterMenu;
|
||||
@FXML private Button tgglPane2Bttn, tgglPane3Bttn, tgglPane4Bttn;
|
||||
@FXML private AnchorPane masterBase, base1, base2, base3, base4, splitPaneBottomAnchor;
|
||||
@FXML private SplitPane masterSplitPane, splitPaneTop, splitPaneBottom;
|
||||
@FXML private TabPane tabPane1, tabPane2, tabPane3, tabPane4;
|
||||
|
||||
// Generics
|
||||
private static Node pane2Node, pane3Node, pane4Node, masterTopNode, masterBottomNode;
|
||||
private static boolean stateOfCol2 = true, stateOfCol3 = true,
|
||||
stateOfCol4 = true, botomRowInserted = true;
|
||||
private static int bottomCount = 2, selectedTabView;
|
||||
private static final String homeDir = System.getProperty("user.home");;
|
||||
private static final Timer garbageTimer = new Timer();
|
||||
|
||||
private TabView tabView;
|
||||
private Tab tab;
|
||||
|
||||
|
||||
@FXML void initialize() {
|
||||
assert masterBase != null : "fx:id=\"masterBase\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert masterMenu != null : "fx:id=\"masterMenu\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert tgglPane2Bttn != null : "fx:id=\"tgglPane2Bttn\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert tgglPane3Bttn != null : "fx:id=\"tgglPane3Bttn\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert tgglPane4Bttn != null : "fx:id=\"tgglPane4Bttn\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert splitPaneTop != null : "fx:id=\"splitPaneTop\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert base1 != null : "fx:id=\"base1\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert tabPane1 != null : "fx:id=\"tabPane1\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert base2 != null : "fx:id=\"base2\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert tabPane2 != null : "fx:id=\"tabPane2\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert splitPaneBottom != null : "fx:id=\"splitPaneBottom\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert base3 != null : "fx:id=\"base3\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert tabPane3 != null : "fx:id=\"tabPane3\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert base4 != null : "fx:id=\"base4\" was not injected: check your FXML file 'window.fxml'.";
|
||||
assert tabPane4 != null : "fx:id=\"tabPane4\" was not injected: check your FXML file 'window.fxml'.";
|
||||
|
||||
masterTopNode = masterSplitPane.getItems().get(0); // In slot "1" of masterSplitPane
|
||||
masterBottomNode = masterSplitPane.getItems().get(1); // In slot "2" of masterSplitPane
|
||||
pane2Node = splitPaneTop.getItems().get(1); // In slot 2 of splitPaneTop
|
||||
pane3Node = splitPaneBottom.getItems().get(0); // In slot "1" of splitPaneBottom
|
||||
pane4Node = splitPaneBottom.getItems().get(1); // In slot "2" of splitPaneBottom
|
||||
|
||||
setTimeTasks(); // Garbage collection
|
||||
setClickEvents();
|
||||
loadDefaultPanes();
|
||||
}
|
||||
|
||||
// Add new tab to location
|
||||
@FXML void newTab(MouseEvent mouseEvent) {
|
||||
if(mouseEvent.getClickCount() == 1 && mouseEvent.isControlDown() ) {
|
||||
generateTab();
|
||||
}
|
||||
}
|
||||
|
||||
// Make new tabs
|
||||
void generateTab() {
|
||||
tab = new Tab(homeDir);
|
||||
tabView = new TabView();
|
||||
tabView.setDirLoc(homeDir);
|
||||
tabView.startIconGeneration();
|
||||
|
||||
tab.setContent(tabView.getContent());
|
||||
|
||||
if (selectedTabView == 1) {
|
||||
tabPane1.getTabs().add(tab);
|
||||
tabPane1.getSelectionModel().select(tab);
|
||||
} else if (selectedTabView == 2) {
|
||||
tabPane2.getTabs().add(tab);
|
||||
tabPane2.getSelectionModel().select(tab);
|
||||
} else if (selectedTabView == 3) {
|
||||
tabPane3.getTabs().add(tab);
|
||||
tabPane3.getSelectionModel().select(tab);
|
||||
} else if (selectedTabView == 4) {
|
||||
tabPane4.getTabs().add(tab);
|
||||
tabPane4.getSelectionModel().select(tab);
|
||||
}
|
||||
}
|
||||
|
||||
@FXML void openLocation(DragEvent event) {
|
||||
// tabs will open folder locations in selected tab if drag in is folder
|
||||
}
|
||||
|
||||
// Sets upo the hide buttons top right.
|
||||
private void setClickEvents() {
|
||||
tgglPane2Bttn.setOnAction(col2 -> {
|
||||
if (stateOfCol2 == true) {
|
||||
splitPaneTop.getItems().remove(pane2Node);
|
||||
splitPaneTop.setDividerPositions(0.5f, 0.0f);
|
||||
stateOfCol2 = false;
|
||||
tgglPane2Bttn.setStyle("-fx-background-color: #880000;");
|
||||
} else {
|
||||
splitPaneTop.getItems().add(pane2Node);
|
||||
splitPaneTop.setDividerPositions(0.5f, 0.10f);
|
||||
stateOfCol2 = true;
|
||||
tgglPane2Bttn.setStyle("-fx-background-color: #008800;");
|
||||
}
|
||||
});
|
||||
tgglPane3Bttn.setOnAction(col3 -> {
|
||||
if (stateOfCol3 == true) {
|
||||
splitPaneBottom.getItems().remove(pane3Node);
|
||||
splitPaneBottom.setDividerPositions(0.0f, 0.10f);
|
||||
bottomCount -= 1;
|
||||
stateOfCol3 = false;
|
||||
horizontalBarState();
|
||||
tgglPane3Bttn.setStyle("-fx-background-color: #880000;");
|
||||
} else {
|
||||
splitPaneBottom.getItems().add(pane3Node);
|
||||
splitPaneBottom.setDividerPositions(0.5f, 0.10f);
|
||||
stateOfCol3 = true;
|
||||
bottomCount += 1;
|
||||
horizontalBarState();
|
||||
tgglPane3Bttn.setStyle("-fx-background-color: #008800;");
|
||||
}
|
||||
});
|
||||
tgglPane4Bttn.setOnAction(col4 -> {
|
||||
if (stateOfCol4 == true) {
|
||||
splitPaneBottom.getItems().remove(pane4Node);
|
||||
splitPaneBottom.setDividerPositions(0.5f, 0.0f);
|
||||
bottomCount -= 1;
|
||||
stateOfCol4 = false;
|
||||
horizontalBarState();
|
||||
tgglPane4Bttn.setStyle("-fx-background-color: #880000;");
|
||||
} else {
|
||||
splitPaneBottom.getItems().add(pane4Node);
|
||||
splitPaneBottom.setDividerPositions(0.5f, 0.10f);
|
||||
stateOfCol4 = true;
|
||||
bottomCount += 1;
|
||||
horizontalBarState();
|
||||
tgglPane4Bttn.setStyle("-fx-background-color: #008800;");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Do periodic garbage collection.
|
||||
private void setTimeTasks() {
|
||||
garbageTimer.schedule(new TimerTask() { public void run() {
|
||||
System.gc();
|
||||
}}, 1, 10500);
|
||||
// Need to properly close this.... upon system close
|
||||
}
|
||||
|
||||
// On start of file manager.
|
||||
// Need to eventually check settings to load sessions...
|
||||
private void loadDefaultPanes() {
|
||||
selectedTabView = 1;
|
||||
generateTab();
|
||||
selectedTabView = 2;
|
||||
generateTab();
|
||||
selectedTabView = 3;
|
||||
generateTab();
|
||||
selectedTabView = 4;
|
||||
generateTab();
|
||||
}
|
||||
|
||||
// Determin if bottom two panes are shown or not
|
||||
private void horizontalBarState() {
|
||||
if (bottomCount == 0) {
|
||||
masterSplitPane.getItems().remove(masterBottomNode);
|
||||
botomRowInserted = false;
|
||||
} else if (bottomCount == 1 && botomRowInserted != true) {
|
||||
masterSplitPane.getItems().add(masterBottomNode);
|
||||
botomRowInserted = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Used so that we can call proper add option for tabinsert
|
||||
@FXML void setSelectedTo1(MouseEvent event) { selectedTabView = 1; }
|
||||
@FXML void setSelectedTo2(MouseEvent event) { selectedTabView = 2; }
|
||||
@FXML void setSelectedTo3(MouseEvent event) { selectedTabView = 3; }
|
||||
@FXML void setSelectedTo4(MouseEvent event) { selectedTabView = 4; }
|
||||
}
|
200
Java Peojects/UDE/UFM/src/TabSystem/Icon.java
Normal file
@@ -0,0 +1,200 @@
|
||||
package com.itdominator.ufm.TabSystem;
|
||||
|
||||
import com.itdominator.ufm.ThumbnailSystem.Thumbnail;
|
||||
|
||||
import javafx.stage.Stage;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Tooltip;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.scene.Cursor;
|
||||
import java.util.Scanner;
|
||||
import java.io.File;
|
||||
|
||||
import javafx.scene.layout.TilePane;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
|
||||
public class Icon extends TabView {
|
||||
// Class objects
|
||||
private Thumbnail thumbnail = new Thumbnail();
|
||||
|
||||
// Generics
|
||||
private TilePane tilePane = new TilePane();
|
||||
private TextField txtDirPath = new TextField();
|
||||
|
||||
private VBox icon = new VBox();
|
||||
private Image img;
|
||||
private ImageView imgView = new ImageView();
|
||||
private Label title = new Label("");
|
||||
private Tooltip tooltip;
|
||||
private Process pb; // Process runner
|
||||
private Scanner scanner;
|
||||
private File file;
|
||||
private boolean isDir = false, isImage = false;
|
||||
|
||||
private String containsStr = System.getProperty("user.home")+ "/Desktop/",
|
||||
toLaunch = "", runCommand = "", thumbImg = "",
|
||||
toShellOut = "", toShellExec = "", line = "",
|
||||
path = "", name = "";
|
||||
private double orgSceneX, orgSceneY, orgTranslateX, orgTranslateY;
|
||||
|
||||
public VBox getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void createIcon(String pth, String nme) {
|
||||
icon.getStyleClass().add("icon");
|
||||
|
||||
path = pth;
|
||||
name = nme;
|
||||
|
||||
// Creates Icon parts for desktop and sets click actions
|
||||
getIconImg();
|
||||
mergeIconParts();
|
||||
setExecuteModel();
|
||||
setIconEvents();
|
||||
}
|
||||
|
||||
private void getIconImg() {
|
||||
thumbnail.setIconImg(path, name);
|
||||
thumbImg = thumbnail.getIconImg();
|
||||
if (thumbImg.contains("systemFile.png")) {
|
||||
if (name.matches("^.*?(doc|docx|odf).*$")) {
|
||||
imgView.getStyleClass().add("icon-document");
|
||||
} else if (name.matches("^.*?(pps|ppt|pptx).*$")) {
|
||||
imgView.getStyleClass().add("icon-presentation");
|
||||
} else if (name.matches("^.*?(xls|xlsx|csv).*$")) {
|
||||
imgView.getStyleClass().add("icon-spreadsheet");
|
||||
} else if (name.matches("^.*?(mp2|mp3|ogg).*$")) {
|
||||
imgView.getStyleClass().add("icon-music");
|
||||
} else if (name.matches("^.*?(txt|sh|link).*$")) {
|
||||
imgView.getStyleClass().add("icon-text");
|
||||
} else if (name.matches("^.*?(run|bin|jar).*$")) {
|
||||
imgView.getStyleClass().add("icon-bin");
|
||||
} else if (name.matches("^.*?(zip|7zip|rar|tar|tar.gz|gz).*$")) {
|
||||
imgView.getStyleClass().add("icon-compressed");
|
||||
} else if (name.matches("^.*?(html|xml|htm|css).*$")) {
|
||||
imgView.getStyleClass().add("icon-web");
|
||||
} else {
|
||||
imgView.getStyleClass().add("icon-folder");
|
||||
}
|
||||
} else if (name.matches("^.*?(png|svg|jpg|jpeg|tiff|gif).*$")) {
|
||||
placeImage();
|
||||
isImage = true;
|
||||
} else { placeImage(); }
|
||||
imgView.setCache(true); // Improves responsiveness when there are many images
|
||||
}
|
||||
|
||||
private void placeImage() {
|
||||
img = new Image("file:" + thumbImg);
|
||||
imgView.setImage(img);
|
||||
imgView.setFitWidth(96.0);
|
||||
imgView.setFitHeight(96.0);
|
||||
}
|
||||
|
||||
private void mergeIconParts() {
|
||||
title.setMaxWidth(150); // Based On Character Count??
|
||||
title.setText(name);
|
||||
tooltip = new Tooltip(name);
|
||||
tooltip.minHeight(800);
|
||||
tooltip.minWidth(800);
|
||||
Tooltip.install(icon, tooltip);
|
||||
icon.getChildren().addAll(imgView, title); // Insert image and name to icon VBox container
|
||||
}
|
||||
|
||||
private void setExecuteModel() {
|
||||
// Set file execution for .desktop files and directories else use xdg-open
|
||||
toLaunch = path;
|
||||
file = new File(path);
|
||||
if (path.contains(".desktop")) {
|
||||
try {
|
||||
scanner = new Scanner(file);
|
||||
while(scanner.hasNext()) {
|
||||
line = scanner.nextLine();
|
||||
if(line.contains("Exec=")) {
|
||||
toShellOut = line;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch(Throwable lineErr) {
|
||||
System.out.println("Failed To Get Exec Info: " + lineErr);
|
||||
}
|
||||
|
||||
if (toShellOut.contains("TryExec="))
|
||||
toShellOut = toShellOut.replaceAll("TryExec=","");
|
||||
else if (toShellOut.contains("Exec="))
|
||||
toShellOut = toShellOut.replaceAll("Exec=","");
|
||||
runCommand = toShellOut;
|
||||
} else if (!file.isFile()) {
|
||||
isDir = true;
|
||||
}
|
||||
else {
|
||||
runCommand = "xdg-open " + toLaunch;
|
||||
}
|
||||
}
|
||||
|
||||
private void setIconEvents() {
|
||||
icon.addEventFilter(MouseEvent.MOUSE_PRESSED,
|
||||
new EventHandler<MouseEvent>() {
|
||||
@Override public void handle(MouseEvent click) {
|
||||
if (click.getClickCount() == 2) {
|
||||
click.consume();
|
||||
if (isDir == true) {
|
||||
if (path.equals("..")) {
|
||||
path = txtDirPath.getText();
|
||||
int start = 0, end = path.length() - 1;
|
||||
for (int i=end; i>0; i--) {
|
||||
if (path.charAt(i) == '/') {
|
||||
start = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
path = path.substring(0, start);
|
||||
setTabView(path, tilePane, txtDirPath);
|
||||
} else {
|
||||
System.out.println(path);
|
||||
setTabView(path, tilePane, txtDirPath);
|
||||
}
|
||||
} else if (isImage == true) {
|
||||
openImage();
|
||||
} else {
|
||||
try {
|
||||
System.out.println(runCommand);
|
||||
pb = Runtime.getRuntime().exec(runCommand);
|
||||
} catch(Throwable imgIOErr) {
|
||||
System.out.println(imgIOErr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void openImage() {
|
||||
Stage imagStage = new Stage();
|
||||
Pane pane = new Pane();
|
||||
ImageView iView = new ImageView(img);
|
||||
pane.getChildren().add(iView);
|
||||
iView.setLayoutX(0);
|
||||
iView.setLayoutY(0);
|
||||
iView.fitWidthProperty().bind(pane.widthProperty());
|
||||
iView.fitHeightProperty().bind(pane.heightProperty());
|
||||
iView.setPreserveRatio(true);
|
||||
Scene scene = new Scene(pane, 800, 800);
|
||||
imagStage.setTitle("" + img);
|
||||
imagStage.setScene(scene);
|
||||
imagStage.show();
|
||||
}
|
||||
|
||||
protected void setWorkingTab(TilePane tP, TextField tF) {
|
||||
this.tilePane = tP;
|
||||
this.txtDirPath = tF;
|
||||
}
|
||||
}
|
100
Java Peojects/UDE/UFM/src/TabSystem/TabView.java
Normal file
@@ -0,0 +1,100 @@
|
||||
package com.itdominator.ufm.TabSystem;
|
||||
|
||||
import com.itdominator.ufm.Controller;
|
||||
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.TilePane;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.ScrollPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.geometry.Pos;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
public class TabView extends Controller {
|
||||
// Tab Info
|
||||
private AnchorPane anchorPane = new AnchorPane();
|
||||
private ScrollPane scrollPane = new ScrollPane();
|
||||
private TilePane tilePane = new TilePane();
|
||||
private TextField txtDirPath = new TextField();
|
||||
private VBox iconVBox;
|
||||
|
||||
private ImageView imgView;
|
||||
private Label dir, fileName;
|
||||
private static File[] fileList;
|
||||
private static File directory;
|
||||
private static String loadPath;
|
||||
private static final String homeDir = System.getProperty("user.home");;
|
||||
private static boolean showHidden = false;
|
||||
private Tab tab = new Tab();
|
||||
|
||||
public TabView() {
|
||||
anchorPane.getChildren().addAll(txtDirPath, scrollPane);
|
||||
anchorPane.setTopAnchor(txtDirPath, 0.0);
|
||||
anchorPane.setLeftAnchor(txtDirPath, 0.0);
|
||||
anchorPane.setRightAnchor(txtDirPath, 0.0);
|
||||
anchorPane.setTopAnchor(scrollPane, 30.0);
|
||||
anchorPane.setLeftAnchor(scrollPane, 0.0);
|
||||
anchorPane.setRightAnchor(scrollPane, 0.0);
|
||||
anchorPane.setBottomAnchor(scrollPane, 0.0);
|
||||
scrollPane.setFitToWidth(true);
|
||||
scrollPane.setContent(tilePane);
|
||||
txtDirPath.setText(homeDir);
|
||||
txtDirPath.getStyleClass().add("fileURLField");
|
||||
tilePane.getStyleClass().add("tile-pane");
|
||||
tilePane.setMaxWidth(Region.USE_PREF_SIZE);
|
||||
}
|
||||
|
||||
public AnchorPane getContent() { return anchorPane; }
|
||||
public void setDirLoc(String loadPath) { this.loadPath = loadPath; }
|
||||
|
||||
public void startIconGeneration() {
|
||||
generateIcons();
|
||||
}
|
||||
|
||||
private void generateIcons() {
|
||||
directory = new File(txtDirPath.getText());
|
||||
fileList = directory.listFiles();
|
||||
for (int i=-1; i<fileList.length; i++) {
|
||||
if (i==-1) { // Insert .. to go up
|
||||
final Icon icon = new Icon();
|
||||
icon.setWorkingTab(tilePane, txtDirPath);
|
||||
final String fileName = "..", file = "..";
|
||||
icon.createIcon(file, fileName);
|
||||
tilePane.getChildren().add(icon.getIcon());
|
||||
i = 0;
|
||||
} else {
|
||||
final Icon icon = new Icon();
|
||||
icon.setWorkingTab(tilePane, txtDirPath);
|
||||
final String fileName = "" + fileList[i].getName(),
|
||||
file = "" + fileList[i];
|
||||
if (showHidden != true) {
|
||||
if (fileName.charAt(0) != '.') {
|
||||
icon.createIcon(file, fileName);
|
||||
tilePane.getChildren().add(icon.getIcon());
|
||||
}
|
||||
} else {
|
||||
icon.createIcon(file, fileName);
|
||||
tilePane.getChildren().add(icon.getIcon());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void setTabView(String path, TilePane tP, TextField tF) {
|
||||
this.tilePane = tP;
|
||||
this.txtDirPath = tF;
|
||||
tilePane.getChildren().clear();
|
||||
txtDirPath.setText(path);
|
||||
generateIcons();
|
||||
}
|
||||
|
||||
protected void setShowHiddenState(boolean state) {
|
||||
showHidden = state;
|
||||
}
|
||||
}
|
28
Java Peojects/UDE/UFM/src/ThumbnailSystem/CleanPath.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.itdominator.ufm.ThumbnailSystem;
|
||||
|
||||
|
||||
// Clear file of special characters and spaces
|
||||
import java.io.File;
|
||||
|
||||
public class CleanPath {
|
||||
private static String preLine = "";
|
||||
|
||||
public String cleanThumbPth(String tmp) {
|
||||
File f = new File(tmp);
|
||||
|
||||
// if it's a directory, don't remove the extention
|
||||
if (f.isDirectory()) System.out.println("This is a a directory.");
|
||||
String name = f.getName();
|
||||
final int lastPeriodPos = name.lastIndexOf('.');
|
||||
if (lastPeriodPos <= 0) {
|
||||
preLine = "" + name;
|
||||
} else {
|
||||
// Remove the last period and everything after it
|
||||
File renamed = new File(f.getParent(), name.substring(0, lastPeriodPos));
|
||||
preLine = "" + renamed;
|
||||
preLine = preLine.replaceAll("[^A-Za-z]+", "");
|
||||
preLine = preLine.replaceAll("\\s+","");
|
||||
}
|
||||
return preLine;
|
||||
}
|
||||
}
|
73
Java Peojects/UDE/UFM/src/ThumbnailSystem/Thumbnail.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package com.itdominator.ufm.ThumbnailSystem;
|
||||
|
||||
|
||||
// Generates the actual image of the icon.
|
||||
import java.util.Scanner;
|
||||
import java.io.File;
|
||||
import java.lang.Runtime;
|
||||
|
||||
|
||||
public class Thumbnail {
|
||||
// Class objects
|
||||
private CleanPath cleaner = new CleanPath(); // Cleans thumbnail names
|
||||
private ThumbnailGenerator vidThumbnailGen = new ThumbnailGenerator();
|
||||
|
||||
// Generics
|
||||
private static File highColorDir = new File(System.getProperty("user.home") +
|
||||
"/.local/share/icons/hicolor/256x256/apps/"),
|
||||
localApplicationsDir = new File(System.getProperty("user.home") +
|
||||
"/.local/share/applications/");
|
||||
private static File[] highColorDirList = highColorDir.listFiles(),
|
||||
localApplicationsDirList = localApplicationsDir.listFiles();
|
||||
|
||||
// Generics
|
||||
private static Scanner scanner;
|
||||
private static File file;
|
||||
private static String thumbImg = "", line = "", temp = "";
|
||||
|
||||
|
||||
public String getIconImg() {
|
||||
return thumbImg;
|
||||
}
|
||||
|
||||
public void setIconImg(String path, String name) {
|
||||
temp = path.toLowerCase();
|
||||
|
||||
if (temp.matches("^.*?(avi|webm|mpeg|mpg|mkv|flv|wmv|mp4).*$")) {
|
||||
thumbImg = vidThumbnailGen.generateThumb(path, cleaner.cleanThumbPth(name));
|
||||
} else if (temp.matches("^.*?(png|svg|jpg|jpeg|tiff|gif).*$")) {
|
||||
thumbImg = path;
|
||||
} else if (temp.contains(".desktop")) {
|
||||
file = new File(path);
|
||||
try {
|
||||
scanner = new Scanner(file);
|
||||
while(scanner.hasNext()) {
|
||||
line = scanner.nextLine();
|
||||
if(line.contains("Icon=")) {
|
||||
thumbImg = line;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch(Throwable lineErr) {
|
||||
System.out.println("Failed To Get Icon: " + lineErr);
|
||||
}
|
||||
thumbImg = thumbImg.replaceAll("Icon=",""); // Strip Icon= from the icon info
|
||||
|
||||
// Steam Icons
|
||||
if (thumbImg.contains("steam_icon")) {
|
||||
for (int i=0; i<highColorDirList.length; i++) {
|
||||
if (highColorDirList[i].toString().contains(thumbImg)) {
|
||||
thumbImg = "" + highColorDirList[i];
|
||||
}
|
||||
}
|
||||
for (int i=0; i<localApplicationsDirList.length; i++) {
|
||||
if (localApplicationsDirList[i].toString().contains(thumbImg)) {
|
||||
thumbImg = "" + localApplicationsDirList[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
thumbImg = "resources/generic-theme/systemFile.png";
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
package com.itdominator.ufm.ThumbnailSystem;
|
||||
|
||||
|
||||
// Generate Thumbnails for videos with ffmpegthumbnailer
|
||||
|
||||
public class ThumbnailGenerator {
|
||||
private Process pb; // Process runner
|
||||
private String thumbName, genCommand;
|
||||
|
||||
public String generateThumb(String file, String thumb) {
|
||||
thumbName = thumb;
|
||||
genCommand = "ffmpegthumbnailer -w -t='00:30:00' -c png -i " +
|
||||
file + " -s 300 -o " + "thumbs/" + thumbName + ".png";
|
||||
try {
|
||||
pb = Runtime.getRuntime().exec(genCommand);
|
||||
pb.waitFor();
|
||||
} catch(Throwable imgIOErr) {
|
||||
System.out.println(imgIOErr);
|
||||
}
|
||||
thumbName = "./thumbs/" + thumbName + ".png";
|
||||
return thumbName;
|
||||
}
|
||||
}
|
38
Java Peojects/UDE/UFM/src/UFM.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.itdominator.ufm;
|
||||
|
||||
import com.itdominator.ufm.Utils.UFMLogger;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.image.Image;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public class UFM extends Application {
|
||||
// Classes
|
||||
private UFMLogger ufmLogger = UFMLogger.getInstance();
|
||||
|
||||
@Override public void start(Stage stage) {
|
||||
try {
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("resources/UFM_Win.fxml"));
|
||||
loader.setController(new Controller());
|
||||
loader.load();
|
||||
Scene scene = new Scene(loader.getRoot());
|
||||
scene.getStylesheets().add("/com/itdominator/ufm/resources/stylesheet.css");
|
||||
stage.setTitle("UFM");
|
||||
stage.setScene(scene);
|
||||
} catch (IOException startException) {
|
||||
String message = "\nUFM Failed to launch...\n";
|
||||
System.out.println(message + startException);
|
||||
ufmLogger.insertToLog(Level.SEVERE, message, startException);
|
||||
}
|
||||
stage.getIcons().add(new Image(UFM.class.getResourceAsStream("resources/UFM.png")));
|
||||
stage.setResizable(false);
|
||||
stage.show();
|
||||
}
|
||||
public static void main(String[] args) { launch(args); }
|
||||
}
|
18
Java Peojects/UDE/UFM/src/Utils/Settings.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.itdominator.ufm.Utils;
|
||||
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
|
||||
public class Settings {
|
||||
private static Settings settings = new Settings();
|
||||
|
||||
private Settings() {
|
||||
|
||||
}
|
||||
|
||||
public static Settings getInstance() { return settings; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
31
Java Peojects/UDE/UFM/src/Utils/UFMLogger.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.itdominator.ufm.Utils;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.FileHandler;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public class UFMLogger {
|
||||
private static UFMLogger ufmLogger = new UFMLogger();
|
||||
private Logger logger = Logger.getLogger(UFMLogger.class.getName());
|
||||
private boolean append = false;
|
||||
|
||||
// Instance passer
|
||||
public static UFMLogger getInstance() { return ufmLogger; }
|
||||
|
||||
// Init UFMLogger
|
||||
private UFMLogger() {
|
||||
try {
|
||||
FileHandler logFile = new FileHandler("ufm_error.log", append);
|
||||
logger.addHandler(logFile);
|
||||
} catch (IOException e) {
|
||||
insertToLog(Level.SEVERE, "Can not access error log file...", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void insertToLog(Level severity, String message, Exception stackTrace) {
|
||||
logger.log(severity, message, stackTrace);
|
||||
}
|
||||
}
|