Package help.screenshot

# Class GhidraScreenShotGenerator

java.lang.Object
generic.test.AbstractGTest
generic.test.AbstractGenericTest
generic.test.AbstractGuiTest
docking.test.AbstractDockingTest
ghidra.test.AbstractGhidraHeadlessIntegrationTest
ghidra.test.AbstractGhidraHeadedIntegrationTest
help.screenshot.AbstractScreenShotGenerator
help.screenshot.GhidraScreenShotGenerator

public abstract class GhidraScreenShotGenerator extends AbstractScreenShotGenerator
Extend this class to create screen shot images for help. The name of the class determines the topic directory where the captured image will be stored. So if the class name is XyzShreenShots, the resulting captured image will appear in help topic directly "Xyz", regardless of which module has that topic. The test name will determine the name of the image file that is generated. So if the test name is testHappyBirthday, the filename will be HappyBirthday.png.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class generic.test.AbstractGuiTest

  `AbstractGuiTest.ExceptionHandlingRunner`

- ## Field Summary

  ### Fields inherited from class help.screenshot.AbstractScreenShotGenerator

  `DEFAULT_FILENAME_SUFFIX, DIALOG_HEADER_HEIGHT, env, image, NEW_FILENAME_SUFFIX, NEW_FILENAME_SUFFIX_KEY, program, SAVE_CREATED_IMAGE_FILE, SAVE_CREATED_IMAGE_FILE_KEY, SCREENSHOT_USER_NAME, tool`

  ### Fields inherited from class ghidra.test.AbstractGhidraHeadlessIntegrationTest

  `PROJECT_NAME`

  ### Fields inherited from class generic.test.AbstractGenericTest

  `concurrentTestExceptionRule, DEFAULT_TEST_TOOL_NAME, DEFAULT_TOOL_NAME, ruleChain, TESTDATA_DIRECTORY_NAME, watchman`

  ### Fields inherited from class generic.test.AbstractGTest

  `BATCH_MODE, DEFAULT_WAIT_DELAY, DEFAULT_WAIT_TIMEOUT, DEFAULT_WINDOW_TIMEOUT, ignoreUnfinishedRule, PARALLEL_MODE, PRIVATE_LONG_WAIT_TIMEOUT, repeatedRule, testName`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `GhidraScreenShotGenerator()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `finished(File helpTopic, String oldImageName)`
  Call when you are finished generating a new image.
  `protected FrontEndTool`
  `getFrontEndTool()`
  `protected File`
  `getHelpTopic()`
  `protected File`
  `getHelpTopicDir(String helpTopic)`
  `protected List<File>`
  `getHelpTopicDirs()`
  `protected String`
  `getHelpTopicName()`
  `protected Image`
  `getOldImage(File helpTopicDir, String imageName)`
  `protected void`
  `handleGIFImage(File gifFile)`
  `void`
  `loadDefaultTool()`
  `void`
  `performFrontEndAction(String actionName, String owner, boolean wait)`
  `protected void`
  `reallySaveToHelp(File helpTopicDir, String imageName)`
  `void`
  `saveOrDisplayImage()`
  Generally, you shouldn't use this.
  `void`
  `saveOrDisplayImage(String name)`
  `void`
  `saveToHelp(String helpTopic, String imageName)`
  Deprecated.
  use instead `finished(File, String)`.
  `void`
  `showImage(String helpTopic, String oldImageName)`
  Deprecated.
  use instead `finished(File, String)`.
  `protected void`
  `showResults()`
  `void`
  `tearDown()`

  ### Methods inherited from class help.screenshot.AbstractScreenShotGenerator

  `addr, address, addSelection, captureActionIcon, captureComponent, captureComponents, captureDialog, captureDialog, captureDialog, captureDialog, captureDialog, captureDialog, captureDialog, captureDialog, captureIcon, captureIsolatedComponent, captureIsolatedProvider, captureIsolatedProvider, captureIsolatedProviderWindow, captureListingField, captureListingRange, captureMenu, captureMenuBarMenu, captureMenuBarMenuHierachy, captureProvider, captureProvider, captureProvider, captureProviderWindow, captureProviderWindow, captureProviderWindow, captureProviderWindow, captureProviderWindow, captureProviderWithScreenShot, captureToolWindow, captureWindow, captureWindow, captureWindow, closeNonProgramArchives, closeProvider, createBookmark, createEmptyImage, crop, doubleClickCursor, drawArrow, drawArrow, drawBorder, drawLine, drawOval, drawRectangle, drawRectangle, drawRectangleAround, drawRectangleAround, drawRectangleWithDropShadowAround, drawText, drawText, error, exit, fillRectangle, findProviderToolBarButton, findRowByPartialText, generateImage, getBounds, getCursorBounds, getDialog, getDialog, getDockableComponent, getDockableComponent, getField, getPopupMenu, getProvider, getProvider, go, goToListing, goToListing, goToListing, hideTableColumn, leftClickCursor, loadPlugin, loadPlugin, loadProgram, loadProgram, makeSelection, makeSelection, middleClickCursor, moveProvider, moveProviderToFront, moveProviderToFront, moveProviderToItsOwnWindow, moveProviderToItsOwnWindow, moveWindowUp, newTestEnv, padImage, paintFix, performAction, performAction, performDialogAction, performMemorySearch, placeImagesSideBySide, positionCursor, positionCursor, positionListingCenter, positionListingTop, prepareCommentsDialog, prepareTool, pressButtonOnDialog, pressOkOnDialog, readImage, removeField, removeFlowArrows, rightClickCursor, scrollToRow, selectRow, selectRow, setDividerPercentage, setDockIcon, setListingFieldWidth, setSelected, setSelectedAnayzer, setToolSize, setUp, setUser, setWindowSize, showAnalysisOptions, showColumnSettings, showCommentDialog, showMenuBarMenu, showOptions, showProgramOptions, showProvider, showTab, showTableColumn, takeSnippet, topOfListing, writeFile`

  ### Methods inherited from class ghidra.test.AbstractGhidraHeadedIntegrationTest

  `addPlugin, click, click, click, click, createApplicationConfiguration, createApplicationLayout, getAction, getPluginByName, saveTool, showDialogWithoutBlocking, showTool, waitForBusyTool, waitForProgram`

  ### Methods inherited from class ghidra.test.AbstractGhidraHeadlessIntegrationTest

  `applyCmd, cleanDbTestDir, clearSelection, createDefaultProgram, createDefaultProgram, debugProgramInTool, deleteProject, getLanguageCompilerSpecPair, getLanguageService, getPlugin, getSLEIGH_8051_LANGUAGE, getSLEIGH_X86_64_LANGUAGE, getSLEIGH_X86_LANGUAGE, getUniqueSymbol, getUniqueSymbol, getZ80_LANGUAGE, goTo, goTo, initializeSystemProperties, makeSelection, makeSelection, makeSelection, makeSelection, modifyProgram, modifyProgram, redo, redo, redo, replaceService, toAddressSet, toAddressSet, toAddressSet, toAddressSet, tx, tx, tx, undo, undo, undo, undo, waitForScriptCompletion`

  ### Methods inherited from class docking.test.AbstractDockingTest

  `assertEnabled, assertIconsEqual, assertToggleButtonSelected, capture, clickComponentProvider, clickComponentProvider, close, close, closeAllWindows, closeAllWindows, closeAllWindowsAndFrames, closeProvider, closeSaveChangesDialog, createContext, createContext, createRenderedImage, createScreenImage, disposeErrorGUI, dockingSetUp, dockingTearDown, expandPath, expandTree, findButtonByActionName, findButtonByIcon, findButtonByName, findButtonByText, findComponent, findComponentByName, getAction, getAction, getAction, getActionsByName, getActionsByOwner, getActionsByOwnerAndName, getClipboardText, getComponentProvider, getDialogComponent, getDialogComponentProvider, getDockableComponent, getLocalAction, getMessageText, getNode, getOpenWindowsAsString, getStatusText, getTitleForWindow, getURL, getWindow, getWindowByTitle, getWindowByTitleContaining, getWindows, isEnabled, isEnabled, isEnabled, isSelected, isToggleButttonSelected, isUseErrorGUI, performAction, performAction, performAction, performAction, performDialogAction, pressButtonByText, pressButtonByText, printOpenWindows, selectPath, selectTabIfAvailable, setErrorGUIEnabled, setToggleActionSelected, setToggleActionSelected, setToggleButtonSelected, setToggleButtonSelected, showProvider, triggerActionKey, triggerActionKey, triggerBackspace, triggerEnter, triggerEscape, triggerKey, triggerKey, triggerKey, triggerText, triggerText, waitForComponentProvider, waitForComponentProvider, waitForComponentProvider, waitForDialogComponent, waitForDialogComponent, waitForDialogComponent, waitForErrorDialog, waitForInfoDialog, waitForJDialog, waitForJDialog, waitForTableModel, waitForTree, waitForUpdateOnChooser, waitForWindow, waitForWindow, waitForWindow, waitForWindowByName, waitForWindowByTitleContaining, writeImage, writeImage`

  ### Methods inherited from class generic.test.AbstractGuiTest

  `assertColorsEqual, clickListRange, clickMouse, clickMouse, clickTableCell, clickTableRange, doubleClick, dragMouse, editCell, executeOnSwingWithoutBlocking, findAbstractButtonByName, findAbstractButtonByText, findButtonByIcon, findButtonByName, findButtonByText, findComponent, findComponent, findComponentByName, findComponentByName, findComponents, findComponents, findOwnedWindows, findPathToText, findTreePathToText, fixupGUI, getAllWindows, getRenderedTableCellValue, getSwing, getText, leftClick, middleClick, moveMouse, postEvent, pressButton, pressButton, pressButtonByName, pressButtonByName, pressButtonByText, pressButtonByText, printMemory, privatewaitForSwing_SwingSafe, rightClick, runSwing, runSwing, runSwing, runSwingLater, runSwingWithException, setComboBoxSelection, setText, waitForExpiringSwingTimers, waitForPostedSwingRunnables, waitForSwing, waitForTasks, waitForTasks, yieldToSwing`

  ### Methods inherited from class generic.test.AbstractGenericTest

  `createStackTraceForAllThreads, createTempDirectory, createTempFile, createTempFile, createTempFileForTest, createTempFileForTest, createTempFilePath, createTempFilePath, deleteMatchingTempFiles, deleteSimilarTempFiles, findTestDataFile, getDebugFileDirectory, getFontMetrics, getInstanceField, getInstanceFieldByClassType, getTestDataDir, getTestDataDirectory, getTestDataFile, hasTestFailed, initializeLayout, invokeConstructor, invokeInstanceMethod, invokeInstanceMethod, loadTextResource, loadTextResource, resetLogging, setErrorsExpected, setInstanceField, setLogLevel, setLogLevel, testFailed, toString, windowForComponent`

  ### Methods inherited from class generic.test.AbstractGTest

  `assertArraysEqualOrdered, assertArraysEqualUnordered, assertArraysEqualUnordered, assertContainsExactly, assertContainsExactly, assertContainsString, assertContainsStringIgnoringCase, assertListEqualOrdered, assertListEqualOrdered, assertListEqualsArrayOrdered, assertListEqualsArrayUnordered, assertListEqualUnordered, bytes, failWithException, getName, getRandomInt, getRandomInt, getRandomString, getRandomString, getTestDirectoryPath, sleep, waitFor, waitFor, waitFor, waitFor, waitFor, waitForCondition, waitForCondition, waitForCondition, waitForConditionWithoutFailing, waitForValue, waitForValueWithoutFailing`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GhidraScreenShotGenerator

    protected GhidraScreenShotGenerator()

- ## Method Details

  - ### tearDown

    public void tearDown() throws Exception
    Overrides:
      `tearDown` in class `AbstractScreenShotGenerator`
    Throws:
      `Exception`

  - ### showResults

    protected void showResults()

  - ### saveOrDisplayImage

    public void saveOrDisplayImage()
    Generally, you shouldn't use this. This is only visible for those who do not directly extend this class.

  - ### saveOrDisplayImage

    public void saveOrDisplayImage(String name)

  - ### handleGIFImage

    protected void handleGIFImage(File gifFile)

  - ### getHelpTopic

    protected File getHelpTopic()

  - ### loadDefaultTool

    public void loadDefaultTool()

  - ### getHelpTopicName

    protected String getHelpTopicName()

  - ### finished

    public void finished(File helpTopic, String oldImageName)
    Call when you are finished generating a new image. This method will either show the newly created image or write it to disk, depending upon the value of `AbstractScreenShotGenerator.SAVE_CREATED_IMAGE_FILE`, which is a system property.
    Parameters:
      `helpTopic` - The help topic that contains the image
      `oldImageName` - The name of the image

  - ### getOldImage

    protected Image getOldImage(File helpTopicDir, String imageName)

  - ### showImage

    @Deprecated public void showImage(String helpTopic, String oldImageName)
    Deprecated.
    use instead `finished(File, String)`.
    Parameters:
      `helpTopic` - The help topic that contains the image
      `oldImageName` - The name of the image

  - ### saveToHelp

    @Deprecated public void saveToHelp(String helpTopic, String imageName)
    Deprecated.
    use instead `finished(File, String)`.
    Parameters:
      `helpTopic` - The help topic that contains the image
      `imageName` - The name of the image

  - ### reallySaveToHelp

    protected void reallySaveToHelp(File helpTopicDir, String imageName)

  - ### getHelpTopicDir

    protected File getHelpTopicDir(String helpTopic)

  - ### getHelpTopicDirs

    protected List<File> getHelpTopicDirs()

  - ### getFrontEndTool

    protected FrontEndTool getFrontEndTool()

  - ### performFrontEndAction

    public void performFrontEndAction(String actionName, String owner, boolean wait)