class YourPhoneWithUISettingsPanel( IngestModuleIngestJobSettingsPanel ): # These are just in case we end up needing an UI # Note, we can't use a self.settings instance variable. # Rather, self.local_settings is used. # https://wiki.python.org/jython/UserGuide#javabean-properties # Jython Introspector generates a property - 'settings' on the basis # of getSettings() defined in this class. Since only getter function # is present, it creates a read-only 'settings' property. This auto- # generated read-only property overshadows the instance-variable - # 'settings' # We get passed in a previous version of the settings so that we can # prepopulate the UI def __init__(self, settings): self.local_settings = settings self.initComponents() def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) # self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.add(self.panel1) # Return the settings used def getSettings(self): return self.local_settings
def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) # self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) panel1 = JPanel() panel1.setLayout(BoxLayout(panel1, BoxLayout.Y_AXIS)) panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.labelPythonPathText = JLabel("Python path: ") self.textFieldPythonPath = JTextField(1) self.buttonSavePythonPath = JButton("Save", actionPerformed=self.textFieldEventPythonPath) self.labelCheckText = JLabel("Run recoveries: ") self.checkboxUndark = JCheckBox("Undark", actionPerformed=self.checkBoxEventUndark) self.checkboxMdg = JCheckBox("MGD Delete Parser", actionPerformed=self.checkBoxEventMdg) self.checkboxCrawler = JCheckBox("WAL Crawler", actionPerformed=self.checkBoxEventCrawler) self.checkboxB2l = JCheckBox("bring2lite", actionPerformed=self.checkBoxEventB2l) self.checkboxUndark.setSelected(True) self.checkboxMdg.setSelected(True) self.add(self.labelPythonPathText) panel1.add(self.textFieldPythonPath) panel1.add(self.buttonSavePythonPath) panel1.add(self.labelCheckText) panel1.add(self.checkboxUndark) panel1.add(self.checkboxMdg) panel1.add(self.checkboxCrawler) panel1.add(self.checkboxB2l) self.add(panel1)
class IMDbUISettingsPanel(IngestModuleIngestJobSettingsPanel): def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() self.area.setText("message, call, user, chat") self.local_settings.setSetting('tableList', self.area.getText()) def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setSetting('Flag', 'true') self.local_settings.setSetting('tableList', self.area.getText()) else: self.local_settings.setSetting('Flag', 'false') def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.checkbox = JCheckBox("Искать таблицы?".decode('UTF-8'), actionPerformed=self.checkBoxEvent) self.label0 = JLabel(" ") self.label1 = JLabel( "Введите названия интересуемых таблиц".decode('UTF-8')) self.label2 = JLabel( "через запятую, после чего установите флажок".decode('UTF-8')) self.label3 = JLabel(" ") self.panel1.add(self.checkbox) self.panel1.add(self.label0) self.panel1.add(self.label1) self.panel1.add(self.label2) self.panel1.add(self.label3) self.add(self.panel1) self.local_settings.setSetting('Flag', 'false') self.area = JTextArea(5, 25) self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)) self.pane = JScrollPane() self.pane.getViewport().add(self.area) self.add(self.pane) def customizeComponents(self): self.checkbox.setSelected( self.local_settings.getSetting('Flag') == 'true') self.area.setText(self.local_settings.getSetting('tableList')) def getSettings(self): return self.local_settings
class PerceptualHashSettingsPanel(IngestModuleIngestJobSettingsPanel): # TODO: Update this for your UI def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() # TODO: Update this for your UI def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setSetting('Flag', 'true') self.local_settings.setSetting('pHash', self.area.getText()) else: self.local_settings.setSetting('Flag', 'false') # TODO: Update this for your UI def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.checkbox = JCheckBox("Check to activate/deactivate pHashToCheck", actionPerformed=self.checkBoxEvent) self.label0 = JLabel(" ") self.label1 = JLabel("Input your phash value for checking: ") self.label2 = JLabel(" ") self.panel1.add(self.checkbox) self.panel1.add(self.label0) self.panel1.add(self.label1) self.panel1.add(self.label2) self.add(self.panel1) self.area = JTextArea(5, 25) self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)) self.pane = JScrollPane() self.pane.getViewport().add(self.area) self.add(self.pane) # TODO: Update this for your UI def customizeComponents(self): self.checkbox.setSelected( self.local_settings.getSetting('Flag') == 'true') self.area.setText(self.local_settings.getSetting('pHash')) # Return the settings used def getSettings(self): return self.local_settings
class Process_EVTX1WithUISettingsPanel(IngestModuleIngestJobSettingsPanel): # Note, we can't use a self.settings instance variable. # Rather, self.local_settings is used. # https://wiki.python.org/jython/UserGuide#javabean-properties # Jython Introspector generates a property - 'settings' on the basis # of getSettings() defined in this class. Since only getter function # is present, it creates a read-only 'settings' property. This auto- # generated read-only property overshadows the instance-variable - # 'settings' # We get passed in a previous version of the settings so that we can # prepopulate the UI # TODO: Update this for your UI def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() # TODO: Update this for your UI def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setSetting('All', 'true') else: self.local_settings.setSetting('All', 'false') if self.checkbox4.isSelected(): self.local_settings.setSetting('Other', 'true') self.local_settings.setSetting('Eventids', self.area.getText()) # self.local_settings.setFlag(False) # self.checkbox.setSelected(self.local_settings.getFlag()) else: self.local_settings.setSetting('Other', 'false') def keyPressed(self, event): self.local_settings.setArea('Eventids', self.area.getText()) # TODO: Update this for your UI def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) #self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.checkbox = JCheckBox("Create Content View of Unique Event Id's", actionPerformed=self.checkBoxEvent) self.checkbox4 = JCheckBox( "Other - Input in text area below then check this box", actionPerformed=self.checkBoxEvent) self.text1 = JLabel( "*** Only run this once otherwise it adds it to the data again.") self.text2 = JLabel(" ") self.text3 = JLabel( "*** Format is a comma delimited text ie: 8001, 8002") self.panel1.add(self.checkbox) self.panel1.add(self.text1) self.panel1.add(self.text2) self.panel1.add(self.checkbox4) self.panel1.add(self.text3) self.add(self.panel1) self.area = JTextArea(5, 25) #self.area.addKeyListener(self) self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)) self.pane = JScrollPane() self.pane.getViewport().add(self.area) #self.pane.addKeyListener(self) #self.add(self.area) self.add(self.pane) # TODO: Update this for your UI def customizeComponents(self): self.checkbox.setSelected( self.local_settings.getSetting('All') == 'true') self.checkbox4.setSelected( self.local_settings.getSetting('Other') == 'true') self.area.setText(self.local_settings.getSetting('Eventids')) # Return the settings used def getSettings(self): return self.local_settings
class NEWProcess_AmcacheWithUISettingsPanel(IngestModuleIngestJobSettingsPanel): # Note, we can't use a self.settings instance variable. # Rather, self.local_settings is used. # https://wiki.python.org/jython/UserGuide#javabean-properties # Jython Introspector generates a property - 'settings' on the basis # of getSettings() defined in this class. Since only getter function # is present, it creates a read-only 'settings' property. This auto- # generated read-only property overshadows the instance-variable - # 'settings' # We get passed in a previous version of the settings so that we can # prepopulate the UI # TODO: Update this for your UI def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() # TODO: Update this for your UI def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setSetting('Default_Mime_Types', 'true') else: self.local_settings.setSetting('Default_Mime_Types', 'false') if self.checkbox1.isSelected(): self.local_settings.setSetting('All_Mime_Types', 'true') else: self.local_settings.setSetting('All_Mime_Types', 'false') if self.checkbox2.isSelected(): self.local_settings.setSetting('Include_Slack_Space', 'true') else: self.local_settings.setSetting('Include_Slack_Space', 'false') # TODO: Update this for your UI def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) #self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.label1 = JLabel("*** Default mime types.") self.label2 = JLabel(" ") self.label3 = JLabel("octet-stream x-splite3 vnd.ms-excel.sheet.4 msoffice") self.label4 = JLabel("msword vnd.ms-excel vnd.ms-powerpoint") self.label5 = JLabel(" ") self.checkbox = JCheckBox("Default Mime Types Files", actionPerformed=self.checkBoxEvent) self.checkbox1 = JCheckBox("All Mime Types Files", actionPerformed=self.checkBoxEvent) self.checkbox2 = JCheckBox("Include Slack Space Of Files", actionPerformed=self.checkBoxEvent) self.panel1.add(self.label1) self.panel1.add(self.label2) self.panel1.add(self.label3) self.panel1.add(self.label4) self.panel1.add(self.label5) self.panel1.add(self.checkbox) self.panel1.add(self.checkbox1) self.panel1.add(self.checkbox2) self.add(self.panel1) # TODO: Update this for your UI def customizeComponents(self): self.checkbox.setSelected(self.local_settings.getSetting('Default_Mime_Types') == 'true') self.checkbox1.setSelected(self.local_settings.getSetting('All_Mime_Types') == 'true') self.checkbox2.setSelected(self.local_settings.getSetting('Include_Slack_Space') == 'true') # Return the settings used def getSettings(self): return self.local_settings
class GUI_PSQLiteUISettingsPanel(IngestModuleIngestJobSettingsPanel): # Note, we can't use a self.settings instance variable. # Rather, self.local_settings is used. # https://wiki.python.org/jython/UserGuide#javabean-properties # Jython Introspector generates a property - 'settings' on the basis # of getSettings() defined in this class. Since only getter function # is present, it creates a read-only 'settings' property. This auto- # generated read-only property overshadows the instance-variable - # 'settings' # We get passed in a previous version of the settings so that we can # prepopulate the UI # TODO: Update this for your UI def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() # TODO: Update this for your UI def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setFlag(True) self.local_settings.setArea(self.area.getText()) else: self.local_settings.setFlag(False) # TODO: Update this for your UI def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) #self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.checkbox = JCheckBox("Check to activate/deactivate TextArea", actionPerformed=self.checkBoxEvent) self.label0 = JLabel(" ") self.label1 = JLabel("Input in SQLite DB's in area below,") self.label2 = JLabel("seperate values by commas.") self.label3 = JLabel("then check the box above.") self.label4 = JLabel(" ") self.panel1.add(self.checkbox) self.panel1.add(self.label0) self.panel1.add(self.label1) self.panel1.add(self.label2) self.panel1.add(self.label3) self.panel1.add(self.label4) self.add(self.panel1) self.area = JTextArea(5, 25) #self.area.getDocument().addDocumentListener(self.area) #self.area.addKeyListener(listener) self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)) self.pane = JScrollPane() self.pane.getViewport().add(self.area) #self.pane.addKeyListener(self.area) #self.add(self.area) self.add(self.pane) # TODO: Update this for your UI def customizeComponents(self): self.checkbox.setSelected(self.local_settings.getFlag()) # Return the settings used def getSettings(self): return self.local_settings
class Parse_SRUDBWithUISettingsPanel(IngestModuleIngestJobSettingsPanel): # Note, we can't use a self.settings instance variable. # Rather, self.local_settings is used. # https://wiki.python.org/jython/UserGuide#javabean-properties # Jython Introspector generates a property - 'settings' on the basis # of getSettings() defined in this class. Since only getter function # is present, it creates a read-only 'settings' property. This auto- # generated read-only property overshadows the instance-variable - # 'settings' # We get passed in a previous version of the settings so that we can # prepopulate the UI # TODO: Update this for your UI def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() # TODO: Update this for your UI def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setFlag(True) else: self.local_settings.setFlag(False) if self.checkbox1.isSelected(): self.local_settings.setFlag1(True) else: self.local_settings.setFlag1(False) if self.checkbox2.isSelected(): self.local_settings.setFlag2(True) else: self.local_settings.setFlag2(False) if self.checkbox3.isSelected(): self.local_settings.setFlag3(True) else: self.local_settings.setFlag3(False) if self.checkbox4.isSelected(): self.local_settings.setFlag4(True) else: self.local_settings.setFlag4(False) if self.checkbox5.isSelected(): self.local_settings.setFlag5(True) else: self.local_settings.setFlag5(False) if self.checkbox5.isSelected(): self.local_settings.setFlag5(True) else: self.local_settings.setFlag5(False) def keyPressed(self, event): self.local_settings.setArea(self.area.getText()) # TODO: Update this for your UI def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) #self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.checkbox = JCheckBox("All Logs", actionPerformed=self.checkBoxEvent) self.checkbox1 = JCheckBox("Application Resource Usage", actionPerformed=self.checkBoxEvent) self.checkbox2 = JCheckBox("Energy Estimation Provider", actionPerformed=self.checkBoxEvent) self.checkbox3 = JCheckBox("Energy Usage Data", actionPerformed=self.checkBoxEvent) self.checkbox4 = JCheckBox("Network Connectivity", actionPerformed=self.checkBoxEvent) self.checkbox5 = JCheckBox("Network Usage", actionPerformed=self.checkBoxEvent) self.checkbox6 = JCheckBox("Windows Push Notification", actionPerformed=self.checkBoxEvent) self.panel1.add(self.checkbox) self.panel1.add(self.checkbox1) self.panel1.add(self.checkbox2) self.panel1.add(self.checkbox3) self.panel1.add(self.checkbox4) self.panel1.add(self.checkbox5) self.panel1.add(self.checkbox6) self.add(self.panel1) # TODO: Update this for your UI def customizeComponents(self): self.checkbox.setSelected(self.local_settings.getFlag()) self.checkbox1.setSelected(self.local_settings.getFlag1()) self.checkbox2.setSelected(self.local_settings.getFlag2()) self.checkbox3.setSelected(self.local_settings.getFlag3()) self.checkbox4.setSelected(self.local_settings.getFlag4()) self.checkbox5.setSelected(self.local_settings.getFlag4()) self.checkbox6.setSelected(self.local_settings.getFlag4()) # Return the settings used def getSettings(self): return self.local_settings
class GUI_PSQLiteUISettingsPanel(IngestModuleIngestJobSettingsPanel): # Note, we can't use a self.settings instance variable. # Rather, self.local_settings is used. # https://wiki.python.org/jython/UserGuide#javabean-properties # Jython Introspector generates a property - 'settings' on the basis # of getSettings() defined in this class. Since only getter function # is present, it creates a read-only 'settings' property. This auto- # generated read-only property overshadows the instance-variable - # 'settings' # We get passed in a previous version of the settings so that we can # prepopulate the UI # TODO: Update this for your UI def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() # TODO: Update this for your UI def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setSetting('Flag', 'true') self.local_settings.setSetting('plists', self.area.getText()); else: self.local_settings.setSetting('Flag', 'false') # TODO: Update this for your UI def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) #self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.checkbox = JCheckBox("Check to activate/deactivate TextArea", actionPerformed=self.checkBoxEvent) self.label0 = JLabel(" ") self.label1 = JLabel("Input in SQLite DB's in area below,") self.label2 = JLabel("seperate values by commas.") self.label3 = JLabel("then check the box above.") self.label4 = JLabel(" ") self.panel1.add(self.checkbox) self.panel1.add(self.label0) self.panel1.add(self.label1) self.panel1.add(self.label2) self.panel1.add(self.label3) self.panel1.add(self.label4) self.add(self.panel1) self.area = JTextArea(5,25) #self.area.getDocument().addDocumentListener(self.area) #self.area.addKeyListener(listener) self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)) self.pane = JScrollPane() self.pane.getViewport().add(self.area) #self.pane.addKeyListener(self.area) #self.add(self.area) self.add(self.pane) # TODO: Update this for your UI def customizeComponents(self): self.checkbox.setSelected(self.local_settings.getSetting('Flag') == 'true') self.area.setText(self.local_settings.getSetting('plists')) # Return the settings used def getSettings(self): return self.local_settings
letWidget.setAlignmentX(Component.LEFT_ALIGNMENT) eventWidget = EventWidget(file, amanda, amandaRef, maps.trackmap) widgetPanel = JPanel() widgetPanel.setLayout(BoxLayout(widgetPanel, BoxLayout.Y_AXIS)) widgetPanel.setMaximumSize(Dimension(400, 600)) widgetPanel.add(letWidget) widgetPanel.add(eventWidget) widgetPanel.add(Box.createHorizontalGlue()) displayPanel = display.getComponent() dim = Dimension(800, 800) displayPanel.setPreferredSize(dim) displayPanel.setMinimumSize(dim) # if widgetPanel alignment doesn't match # displayPanel alignment, BoxLayout will freak out widgetPanel.setAlignmentX(displayPanel.getAlignmentX()) widgetPanel.setAlignmentY(displayPanel.getAlignmentY()) # create JPanel in frame panel = JPanel() panel.setLayout(BoxLayout(panel, BoxLayout.X_AXIS)) panel.add(widgetPanel) panel.add(displayPanel) DisplayFrame("VisAD AMANDA Viewer", display, panel)
class Process_EVTX1WithUISettingsPanel(IngestModuleIngestJobSettingsPanel): # Note, we can't use a self.settings instance variable. # Rather, self.local_settings is used. # https://wiki.python.org/jython/UserGuide#javabean-properties # Jython Introspector generates a property - 'settings' on the basis # of getSettings() defined in this class. Since only getter function # is present, it creates a read-only 'settings' property. This auto- # generated read-only property overshadows the instance-variable - # 'settings' # We get passed in a previous version of the settings so that we can # prepopulate the UI # TODO: Update this for your UI def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() # TODO: Update this for your UI def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setFlag(True) else: self.local_settings.setFlag(False) if self.checkbox1.isSelected(): self.local_settings.setFlag1(True) else: self.local_settings.setFlag1(False) if self.checkbox2.isSelected(): self.local_settings.setFlag2(True) else: self.local_settings.setFlag2(False) if self.checkbox3.isSelected(): self.local_settings.setFlag3(True) else: self.local_settings.setFlag3(False) if self.checkbox4.isSelected(): self.local_settings.setFlag4(True) self.local_settings.setArea(self.area.getText()) else: self.local_settings.setFlag4(False) def keyPressed(self, event): self.local_settings.setArea(self.area.getText()) # TODO: Update this for your UI def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) #self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.checkbox = JCheckBox("All Logs", actionPerformed=self.checkBoxEvent) self.checkbox1 = JCheckBox("Application.Evtx", actionPerformed=self.checkBoxEvent) self.checkbox2 = JCheckBox("Security.EVTX", actionPerformed=self.checkBoxEvent) self.checkbox3 = JCheckBox("System.EVTX", actionPerformed=self.checkBoxEvent) self.checkbox4 = JCheckBox( "Other - Input in text area below then check this box", actionPerformed=self.checkBoxEvent) self.panel1.add(self.checkbox) self.panel1.add(self.checkbox1) self.panel1.add(self.checkbox2) self.panel1.add(self.checkbox3) self.panel1.add(self.checkbox4) self.add(self.panel1) self.area = JTextArea(5, 25) #self.area.addKeyListener(self) self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)) self.pane = JScrollPane() self.pane.getViewport().add(self.area) #self.pane.addKeyListener(self) #self.add(self.area) self.add(self.pane) # TODO: Update this for your UI def customizeComponents(self): self.checkbox.setSelected(self.local_settings.getFlag()) self.checkbox1.setSelected(self.local_settings.getFlag1()) self.checkbox2.setSelected(self.local_settings.getFlag2()) self.checkbox3.setSelected(self.local_settings.getFlag3()) self.checkbox4.setSelected(self.local_settings.getFlag4()) # Return the settings used def getSettings(self): return self.local_settings
class UISettingsPanel(IngestModuleIngestJobSettingsPanel): def __init__(self, settings): self.localSettings = settings self.initComponents() self.customizeComponents() def checkBoxEvent(self, event): self.localSettings.setFlag(self.checkboxJPG.isSelected(), 0) self.localSettings.setFlag(self.checkboxJPEG.isSelected(), 1) self.localSettings.setFlag(self.checkboxPNG.isSelected(), 2) self.localSettings.setFlag(self.checkboxDelete.isSelected(), 3) def onClick(self, e): fileChooser = JFileChooser() fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) ret = fileChooser.showDialog(self.panel, "Choose folder") if ret == JFileChooser.APPROVE_OPTION: file = fileChooser.getSelectedFile() filename = file.getCanonicalPath() self.localSettings.setFace(filename) def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel = JPanel() self.panel.setLayout(BoxLayout(self.panel, BoxLayout.Y_AXIS)) self.panel.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.labelTop = JLabel("Choose file extensions to look for:") self.panel.add(self.labelTop) self.checkboxJPG = JCheckBox(".jpg", actionPerformed=self.checkBoxEvent) self.panel.add(self.checkboxJPG) self.checkboxJPEG = JCheckBox(".jpeg", actionPerformed=self.checkBoxEvent) self.panel.add(self.checkboxJPEG) self.checkboxPNG = JCheckBox(".png", actionPerformed=self.checkBoxEvent) self.panel.add(self.checkboxPNG) self.labelBlank = JLabel(" ") self.panel.add(self.labelBlank) self.checkboxDelete = JCheckBox("Delete files after use", actionPerformed=self.checkBoxEvent) self.panel.add(self.checkboxDelete) self.labelBlank1 = JLabel(" ") self.panel.add(self.labelBlank1) self.label = JLabel( "Provide folder for trainning face (if none will only do detection)" ) self.openb = JButton("Choose", actionPerformed=self.onClick) self.panel.add(self.label) self.panel.add(self.openb) self.add(self.panel) def customizeComponents(self): self.checkboxJPG.setSelected(self.localSettings.getFlag(0)) self.checkboxJPEG.setSelected(self.localSettings.getFlag(1)) self.checkboxPNG.setSelected(self.localSettings.getFlag(2)) self.checkboxDelete.setSelected(self.localSettings.getFlag(3)) def getSettings(self): return self.localSettings
class Process_AmcacheWithUISettingsPanel(IngestModuleIngestJobSettingsPanel): # Note, we can't use a self.settings instance variable. # Rather, self.local_settings is used. # https://wiki.python.org/jython/UserGuide#javabean-properties # Jython Introspector generates a property - 'settings' on the basis # of getSettings() defined in this class. Since only getter function # is present, it creates a read-only 'settings' property. This auto- # generated read-only property overshadows the instance-variable - # 'settings' # We get passed in a previous version of the settings so that we can # prepopulate the UI # TODO: Update this for your UI def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() # TODO: Update this for your UI def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setSetting('associateFileEntries', 'true') else: self.local_settings.setSetting('associateFileEntries', 'false') if self.checkbox1.isSelected(): self.local_settings.setSetting('programEntries', 'true') else: self.local_settings.setSetting('programEntries', 'false') if self.checkbox2.isSelected(): self.local_settings.setSetting('unassociatePrograms', 'true') else: self.local_settings.setSetting('unassociatePrograms', 'true') # TODO: Update this for your UI def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) #self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.checkbox = JCheckBox("Associate File Entries", actionPerformed=self.checkBoxEvent) self.checkbox1 = JCheckBox("Program Entries", actionPerformed=self.checkBoxEvent) self.checkbox2 = JCheckBox("Unassociated Programs", actionPerformed=self.checkBoxEvent) self.panel1.add(self.checkbox) self.panel1.add(self.checkbox1) self.panel1.add(self.checkbox2) self.add(self.panel1) # TODO: Update this for your UI def customizeComponents(self): self.checkbox.setSelected(self.local_settings.getSetting('associateFileEntries') == 'true') self.checkbox1.setSelected(self.local_settings.getSetting('programEntries') == 'true') self.checkbox2.setSelected(self.local_settings.getSetting('unassociatePrograms') == 'true') # Return the settings used def getSettings(self): return self.local_settings
def reloadComponent(game,dialog,node): c = None text = node.getAttribute("text") if node.hasAttribute("text") else "" align = int(node.getAttribute("align")) if node.hasAttribute("align") else 0 #Components if node.nodeName=="jpanel": c = JPanel() c.setBackground(Color.BLACK) layout = createLayoutManager(c,node.getAttribute("layout") if node.hasAttribute("layout") else "flow") c.setLayout(layout) c.setOpaque(False) if node.getAttribute("opaque"): c.setOpaque(node.getAttribute("opaque")=="true") if node.getAttribute("background"): if(node.getAttribute("background")=="orange"): c.setBackground(Color.ORANGE) elif(node.getAttribute("background")=="green"): c.setBackground(Color.GREEN) for child in node.childNodes: if child.nodeName!="#text": if node.getAttribute("layout")=="gridbag": c.add(reloadComponent(game,dialog,child),getGridBagConstraints(game,child)) else: c.add(reloadComponent(game,dialog,child)) elif node.nodeName=="jlabel": c = JLabel(text,align) elif node.nodeName=="jbutton": c = JButton(text) if node.hasAttribute("enabled"): c.setEnabled(node.getAttribute("enabled")=="true"); elif node.nodeName=="settingspanel": c = SettingsPanel(game) for g in node.childNodes: if g.nodeName=="group": c.addGroup(int(g.getAttribute("id")),g.getAttribute("label")) for h in g.childNodes: if h.nodeName=="heading": c.addHeading(int(g.getAttribute("id")),h.getAttribute("label")) for s in h.childNodes: if s.nodeName=="setting": #<setting id="1" name="DISPLAY_REAL_WORLD_TIME" type="checkbox" label="Show Real-World Time"></setting> if s.getAttribute("items")!="": c.addSettingWithItems(int(g.getAttribute("id")),int(s.getAttribute("id")),s.getAttribute("label"),s.getAttribute("type"),s.getAttribute("items").split(",")) else: c.addSetting(int(g.getAttribute("id")),int(s.getAttribute("id")),s.getAttribute("label"),s.getAttribute("type")) c.finalizeSettingsPanel() dialog.registerSettingsPanel(int(node.getAttribute("id")),c) elif node.nodeName=="logspanel": c = LogsPanel(game) for g in node.childNodes: if g.nodeName=="group": c.addLog(int(g.getAttribute("id")),g.getAttribute("label")) c.finalizeLogsPanel() dialog.registerLogsPanel(int(node.getAttribute("id")),c) elif node.nodeName=="nglcanvas": c = NGLCanvas(game,int(getCascadingAttribute(game,node,"width")),int(getCascadingAttribute(game,node,"height"))) dialog.registerCanvas(int(node.getAttribute("id")),c) #Layout if node.parentNode.getAttribute("layout")=="absolute": c.setBounds(getBounds(game,node)) elif node.parentNode.getAttribute("layout")=="box-y": c.setAlignmentX(Component.CENTER_ALIGNMENT); if node.hasAttribute("width") and node.hasAttribute("height"): c.setPreferredSize(Dimension(int(getCascadingAttribute(game,node,"width")),int(getCascadingAttribute(game,node,"height")))) if node.hasAttribute("minWidth") and node.hasAttribute("minHeight"): c.setMinimumSize(Dimension(int(node.getAttribute("minWidth")),int(node.getAttribute("minHeight")))) if node.hasAttribute("maxWidth") and node.hasAttribute("maxHeight"): c.setMaximumSize(Dimension(int(node.getAttribute("maxWidth")),int(node.getAttribute("maxHeight")))) elif node.parentNode.getAttribute("layout")=="box-x": c.setAlignmentY(Component.CENTER_ALIGNMENT); if node.hasAttribute("width") and node.hasAttribute("height"): c.setPreferredSize(Dimension(int(getCascadingAttribute(game,node,"width")),int(getCascadingAttribute(game,node,"height")))) if node.hasAttribute("minWidth") and node.hasAttribute("minHeight"): c.setMinimumSize(Dimension(int(node.getAttribute("minWidth")),int(node.getAttribute("minHeight")))) if node.hasAttribute("maxWidth") and node.hasAttribute("maxHeight"): c.setMaximumSize(Dimension(int(node.getAttribute("maxWidth")),int(node.getAttribute("maxHeight")))) if node.nodeName!="nglcanvas" and node.nodeName!="jpanel" and node.nodeName!="settingspanel": addListeners(game,c,node) return c;
class Process_AmcacheWithUISettingsPanel(IngestModuleIngestJobSettingsPanel): # Note, we can't use a self.settings instance variable. # Rather, self.local_settings is used. # https://wiki.python.org/jython/UserGuide#javabean-properties # Jython Introspector generates a property - 'settings' on the basis # of getSettings() defined in this class. Since only getter function # is present, it creates a read-only 'settings' property. This auto- # generated read-only property overshadows the instance-variable - # 'settings' # We get passed in a previous version of the settings so that we can # prepopulate the UI # TODO: Update this for your UI def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() # TODO: Update this for your UI def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setSetting('associateFileEntries', 'true') else: self.local_settings.setSetting('associateFileEntries', 'false') if self.checkbox1.isSelected(): self.local_settings.setSetting('programEntries', 'true') else: self.local_settings.setSetting('programEntries', 'false') if self.checkbox2.isSelected(): self.local_settings.setSetting('unassociatePrograms', 'true') else: self.local_settings.setSetting('unassociatePrograms', 'true') # TODO: Update this for your UI def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) #self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.checkbox = JCheckBox("Associate File Entries", actionPerformed=self.checkBoxEvent) self.checkbox1 = JCheckBox("Program Entries", actionPerformed=self.checkBoxEvent) self.checkbox2 = JCheckBox("Unassociated Programs", actionPerformed=self.checkBoxEvent) self.panel1.add(self.checkbox) self.panel1.add(self.checkbox1) self.panel1.add(self.checkbox2) self.add(self.panel1) # TODO: Update this for your UI def customizeComponents(self): self.checkbox.setSelected( self.local_settings.getSetting('associateFileEntries') == 'true') self.checkbox1.setSelected( self.local_settings.getSetting('programEntries') == 'true') self.checkbox2.setSelected( self.local_settings.getSetting('unassociatePrograms') == 'true') # Return the settings used def getSettings(self): return self.local_settings
class Process_EVTX1WithUISettingsPanel(IngestModuleIngestJobSettingsPanel): # Note, we can't use a self.settings instance variable. # Rather, self.local_settings is used. # https://wiki.python.org/jython/UserGuide#javabean-properties # Jython Introspector generates a property - 'settings' on the basis # of getSettings() defined in this class. Since only getter function # is present, it creates a read-only 'settings' property. This auto- # generated read-only property overshadows the instance-variable - # 'settings' # We get passed in a previous version of the settings so that we can # prepopulate the UI # TODO: Update this for your UI def __init__(self, settings): self.local_settings = settings self.initComponents() self.customizeComponents() # TODO: Update this for your UI def checkBoxEvent(self, event): if self.checkbox.isSelected(): self.local_settings.setSetting('All', 'true') else: self.local_settings.setSetting('All', 'false') if self.checkbox4.isSelected(): self.local_settings.setSetting('Other', 'true') self.local_settings.setSetting('Eventids', self.area.getText()); # self.local_settings.setFlag(False) # self.checkbox.setSelected(self.local_settings.getFlag()) else: self.local_settings.setSetting('Other', 'false') def keyPressed(self, event): self.local_settings.setArea('Eventids', self.area.getText()) # TODO: Update this for your UI def initComponents(self): self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS)) #self.setLayout(GridLayout(0,1)) self.setAlignmentX(JComponent.LEFT_ALIGNMENT) self.panel1 = JPanel() self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS)) self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT) self.checkbox = JCheckBox("Create Content View of Unique Event Id's", actionPerformed=self.checkBoxEvent) self.checkbox4 = JCheckBox("Other - Input in text area below then check this box", actionPerformed=self.checkBoxEvent) self.text1 = JLabel("*** Only run this once otherwise it adds it to the data again.") self.text2 = JLabel(" ") self.text3 = JLabel("*** Format is a comma delimited text ie: 8001, 8002") self.panel1.add(self.checkbox) self.panel1.add(self.text1) self.panel1.add(self.text2) self.panel1.add(self.checkbox4) self.panel1.add(self.text3) self.add(self.panel1) self.area = JTextArea(5,25) #self.area.addKeyListener(self) self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)) self.pane = JScrollPane() self.pane.getViewport().add(self.area) #self.pane.addKeyListener(self) #self.add(self.area) self.add(self.pane) # TODO: Update this for your UI def customizeComponents(self): self.checkbox.setSelected(self.local_settings.getSetting('All') == 'true') self.checkbox4.setSelected(self.local_settings.getSetting('Other') == 'true') self.area.setText(self.local_settings.getSetting('Eventids')) # Return the settings used def getSettings(self): return self.local_settings
letWidget.setAlignmentX(Component.LEFT_ALIGNMENT) eventWidget = EventWidget(file, amanda, amandaRef, maps.trackmap) widgetPanel = JPanel() widgetPanel.setLayout(BoxLayout(widgetPanel, BoxLayout.Y_AXIS)) widgetPanel.setMaximumSize(Dimension(400, 600)) widgetPanel.add(letWidget) widgetPanel.add(eventWidget) widgetPanel.add(Box.createHorizontalGlue()) displayPanel = display.getComponent() dim = Dimension(800, 800) displayPanel.setPreferredSize(dim) displayPanel.setMinimumSize(dim) # if widgetPanel alignment doesn't match # displayPanel alignment, BoxLayout will freak out widgetPanel.setAlignmentX(displayPanel.getAlignmentX()) widgetPanel.setAlignmentY(displayPanel.getAlignmentY()) # create JPanel in frame panel = JPanel() panel.setLayout(BoxLayout(panel, BoxLayout.X_AXIS)) panel.add(widgetPanel) panel.add(displayPanel) DisplayFrame("VisAD AMANDA Viewer", display, panel)