Skip to content

Getting started with Jetson for developers

R6 edited this page Sep 10, 2023 · 4 revisions

Jetson Main Class

public class extends JFrame A bundle of Jetson utilities in the form of a file manager.

Variables

JETSON_DIRECTORY

public static File

JETSON_RESOURCE_FOLDER

public static File

JETSON_TEMP_TXT

public static File

JETSON_BLOAT_TXT

public static File

JRL

public static final JetRL

JETSON_ERRS

public static final String[]

OS_NAME

public static final String

IS_WINDOWS

public static final boolean

IS_LINUX

public static final boolean

IS_MAC

public static final boolean

mouseX, mouseY

private int

titleBar

private final JPanel

titleLabel

private final JLabel

titleLabelSuffix

private final JLabel

JTextField

private final inputField

JetsonList

private final JetsonList

listPanel

private JPanel

selectedFile

private File

currentDirectory

private File

oneDirectoryUp

private File

monoFont

private final Font

terminalFont

private final Font

Methods

Jetson()

public Creates a new Jetson() GUI with no commands initialized

initialize()

public static void Returns a new Jetson() with all commands initialized

listFiles(File[] directoryFiles)

public void Lists inputted files in listPanel

refreshList()

public void Refreshes listPanel

clearList()

public void Wipes listPanel of any listings

wipe()

public void Wipes Jetson() of all components

goToDirectory(File dir)

public boolean Updates listPanel with new inputted directory files

clearInputField()

public void As the name implies, it clears inputField

refreshList()

public void Refreshes listPanel

deselectAllItems()

public void Deselects all selected listings inside listPanel

updateTitle(String text)

public void Fully updates title of Jetson() everywhere with inputted string

refreshTitleLabel()

public void Refreshes titleLabel inside titleBar

updateScrollBar()

public void Updates custom Jetson scrollbar

close()

public void Closes Jetson() using the default close operator

getTitleBar()

public JPanel Returns titleBar

getTitleLabel()

public JLabel Returns titleLabel

getTitleLabelSuffix()

public JLabel Returns suffix for titleLabel (the label that shows your username or the selected file name)

getSelectedFile()

public File Returns selectedFile

getParentDirectory()

Returns parent directory of current directory

goOneDirectoryUp()

public void Goes one directory up in listPanel

verifyJetsonDirector()

public static void Verifies and checks if .jetson and all verified .jetson files exist. If any non-verified files are present, they are automatically deleted

getJetsonDirectory()

public static File Verifies all .jetson files then returns .jetson

getJetsonResourceFolder()

public static File Returns the Resource folder inside .jetson directory

getJetsonTempTxt()

public static File Verifies all .jetson files then returns Temp.txt inside .jetson

getJetsonBloatTxt()

public static File Verifies all .jetson files then returns Bloat.txt inside .jetson

getJetsonDummyDirectory()

public static File Verifies all .jetson files then returns the Dummy directory (the directory where all directory duplicates are stored) inside .jetson

getListPanel()

public JPanel Returns listPanel

setListPanel(Component listPanel)

public void Sets listPanel to inputted component

getListScrollPane()

public JScrollPane Returns listScrollPane (containing listPanel)

getInputField()

public JTextField Returns inputField

setSelectedFile(File selectedFile)

public void Sets selectedFile to inputted file

setCurrentDirectory(File currentDirectory)

public void Sets currentDirectory to inputted file

corrupt(File file)

Corrupts inputted file, if directory goes through it and corrupts all files in it all child directories

Commands

clear

Clears listPanel

up

Goes one directory up

refresh

Refreshes listPanel

open

Opens selected file or folder externally, should be platform independent

read

Reads selected file and writes its contents to Temp.txt in .jetson

delete

Deletes selected file or folder

corrupt

Corrupts selected file or folder

bloat

Bloats selected file or folder. If selected is a folder it has to have some kind of contents for it to work

dummy

Creates a dummy version of the selected folder and stores it in the Dummy directory in .jetson

minimize

Minimizes Jetson

verify

Verifies .jetson directroy

quit

Exits out of Jetson

ResourceLoader

public abstract class

Variables

RESOURCE_FOLDER

public File

Methods

ResourceLoader(File resourceFolder)

public

getResourceFolder()

public File Returns RESOURCE_FOLDER

getFile(String fileName)

public File Returns the file going by the inputted fileName in RESOURCE_FOLDER

JetRL

public class extends ResourceLoader

Variables

TITLE_BAR_COLOR

public static Color

PRIMARY_BORDER_COLOR

public static Color

SECONDARY_BORDER_COLOR

public static Color

PRIMARY_BACKGROUND_COLOR

public static Color

SECONDARY_BACKGROUND_COLOR

public static Color

PRIMARY_TEXT_COLOR

public static Color

SECONDARY_TEXT_COLOR

public static Color

EDITOR_TEXT_COLOR

public static Color

SCROLL_BAR_HOVER_COLOR

public static Color

Methods

JetRL(File resourceFolder)

public Does super(resourceFolder)

registerFont(File fontToRegister, float size)

public Font throws FontFormatException, IOException Registers inputted font file in the Local Graphics Environment and returns the registered version

createTerminalFont(int size)

public Font Registeres and returns a terminal font depending on the system, just for aesthetics

createTerminalFont()

public Font Returns createTerminalFont(12)

createMonoFont(float size)

public Font Returns JetBrainsMono font if on Windows; createTerminalFont() otherwise

createMonoFont()

public Font Returns createMonoFont(12)

getIcon(String, iconName, short iconSize, int imageScaling)

Returns an icon from RESOURCE_FOLDER with the inputted iconName and all other parameters

JetReader

public class

Methods

readFile(File file)

Reads and returns contents of inputted file

JetSbGen

public class

Methods

createDummy(File dir, File sandbox, File alwaysIgnore)

public static boolean Creates a dummy version of inputted dir and stores it as the file sandbox. Returns true if successful; false otherwise

JetViewer

public class

Methods

view(File file)

public static boolean System-independently views inputted file externally. Returns true, if successful; false otherwise

JetWriter

public class

Methods

write(File file, String data, boolean takeNewLineSyntax)

public static boolean Writes data to file. If takeNewLineSyntax is true: it will properly use \n for new lines; will ignore it otherwise. Returns true if it successfully wrote to the inputted file; false otherwise

write(File file, String data)

Returns write(file, data, false)

JetEraser

public class

Methods

erase(File target)

public static boolean Does a sophisticated deletion of any directory or file inputted. Returns true, if successful; false otherwise

Clone this wiki locally