Class WebViewPanel
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,InfoPanel,org.cytoscape.application.events.SetCurrentNetworkListener,org.cytoscape.application.swing.CytoPanelComponent,org.cytoscape.application.swing.CytoPanelComponent2,org.cytoscape.event.CyListener,org.cytoscape.model.events.RowsSetListener,org.cytoscape.view.model.events.NetworkViewAboutToBeDestroyedListener,org.cytoscape.view.model.events.NetworkViewAddedListener
Browser that
shows the SBML information of the current network and the selected node, or the help
and examples pages.
The HTML is rendered on the LatestTaskExecutor (it may wait for web services)
and published to the browser through the PageLoader.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionWebViewPanel(ServiceAdapter adapter, SBMLManager sbmlManager, SBaseHTMLFactory htmlFactory, CofactorManager cofactorManager, BiomodelsDialog biomodelsDialog) Creates the panel, which shows the help page until the first render. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Shows the results panel with this panel selected, and the information of the current selection, which was not updated while the panel was hidden.voidHides the panel if it is shown, else shows it.voidclose()Stops the render executor.voidHides the results panel, unless it has other components.org.cytoscape.application.swing.CytoPanelNamegetHtml()The HTML text shown last, or null if no rendered text has been shown yet.getIcon()getTitle()voidhandleEvent(org.cytoscape.application.events.SetCurrentNetworkEvent event) Makes the SBML document of the new current network the current document and shows its information.voidhandleEvent(org.cytoscape.model.events.RowsSetEvent event) Shows the information of the selected node when the selection in the node table of the current network changes.voidhandleEvent(org.cytoscape.view.model.events.NetworkViewAboutToBeDestroyedEvent event) Shows the help page when the view of the current network is closed; the view of another network leaves the information of the current network.voidhandleEvent(org.cytoscape.view.model.events.NetworkViewAddedEvent event) Shows the information of the current network once it has a view.booleanisActive()Whether the results panel is shown, so the information is updated.voidselect()Selects this panel in the results panel.voidShows the static examples page.voidsetHelp()Shows the static help page.voidShows the given HTML text.voidshowSBaseInfo(Object obj) Shows the information of the SBase, seeshowSBaseInfo(Set).voidshowSBaseInfo(Set<Object> objSet) Display information for set of nodes.voidUpdates the panel information on the render executor.Methods inherited from class javafx.embed.swing.JFXPanel
addNotify, getInputMethodRequests, getPreferredSize, getScene, isOpaque, paintComponent, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeNotify, setOpaque, setSceneMethods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
WebViewPanel
public WebViewPanel(ServiceAdapter adapter, SBMLManager sbmlManager, SBaseHTMLFactory htmlFactory, CofactorManager cofactorManager, BiomodelsDialog biomodelsDialog) Creates the panel, which shows the help page until the first render.
-
-
Method Details
-
getHtml
The HTML text shown last, or null if no rendered text has been shown yet. -
getCytoPanelName
public org.cytoscape.application.swing.CytoPanelName getCytoPanelName()- Specified by:
getCytoPanelNamein interfaceorg.cytoscape.application.swing.CytoPanelComponent
-
getComponent
- Specified by:
getComponentin interfaceorg.cytoscape.application.swing.CytoPanelComponent
-
getIcon
- Specified by:
getIconin interfaceorg.cytoscape.application.swing.CytoPanelComponent
-
getIdentifier
- Specified by:
getIdentifierin interfaceorg.cytoscape.application.swing.CytoPanelComponent2
-
getTitle
- Specified by:
getTitlein interfaceorg.cytoscape.application.swing.CytoPanelComponent
-
isActive
public boolean isActive()Whether the results panel is shown, so the information is updated. -
activate
public void activate()Shows the results panel with this panel selected, and the information of the current selection, which was not updated while the panel was hidden. -
deactivate
public void deactivate()Hides the results panel, unless it has other components. -
changeState
public void changeState()Hides the panel if it is shown, else shows it. -
select
public void select()Selects this panel in the results panel. -
setHelp
public void setHelp()Shows the static help page.Submitted on the
renderExecutorunder a fresh key (never equal to any other key, including a previous call's), so it is never coalesced away and always cancels whatever render is still pending or running (e.g. a slow web-service lookup for a previous selection): that render can no longer overwrite the help page once it is requested, and the two run in the order they were requested. The page is loaded viapublish(java.util.function.Consumer<org.cy3sbml.gui.PageLoader>), the same publication path the SBase renders use. -
setExamples
public void setExamples()Shows the static examples page. Submitted on therenderExecutorunder a fresh key, same assetHelp(), so an in-flight render cannot overwrite it. -
setText
Shows the given HTML text.Must be called from a render task running on the
renderExecutor; the text is only shown if that task is still the current render (seepublish(java.util.function.Consumer<org.cy3sbml.gui.PageLoader>)). -
showSBaseInfo
Shows the information of the SBase, seeshowSBaseInfo(Set).- Specified by:
showSBaseInfoin interfaceInfoPanel
-
showSBaseInfo
Display information for set of nodes.Runs the HTML generation (the OLS/UniProt/ChEBI web-service lookups) inline, on whatever thread is calling this. The only caller is
PanelUpdater, itself running as the single taskupdateInformation()submits to therenderExecutorfor the current selection. This must stay a plain call and never become a nestedrenderExecutor.submit(...): the executor cancels whatever task it is currently running when a new one is submitted, so a nested submit from inside a task that is itself about to be cancelled would race with, and could cancel, a newer selection's already-submitted task instead of its own. Keeping exactly one submit per selection is what makes that cancellation correct.- Specified by:
showSBaseInfoin interfaceInfoPanel
-
handleEvent
public void handleEvent(org.cytoscape.model.events.RowsSetEvent event) Shows the information of the selected node when the selection in the node table of the current network changes. Rows are set very often, e.g. while a network is created or laid out, so all other row changes are ignored right away.- Specified by:
handleEventin interfaceorg.cytoscape.model.events.RowsSetListener
-
handleEvent
public void handleEvent(org.cytoscape.application.events.SetCurrentNetworkEvent event) Makes the SBML document of the new current network the current document and shows its information.- Specified by:
handleEventin interfaceorg.cytoscape.application.events.SetCurrentNetworkListener
-
handleEvent
public void handleEvent(org.cytoscape.view.model.events.NetworkViewAddedEvent event) Shows the information of the current network once it has a view.- Specified by:
handleEventin interfaceorg.cytoscape.view.model.events.NetworkViewAddedListener
-
handleEvent
public void handleEvent(org.cytoscape.view.model.events.NetworkViewAboutToBeDestroyedEvent event) Shows the help page when the view of the current network is closed; the view of another network leaves the information of the current network.- Specified by:
handleEventin interfaceorg.cytoscape.view.model.events.NetworkViewAboutToBeDestroyedListener
-
updateInformation
public void updateInformation()Updates the panel information on the render executor.Resolves the render target (see
PanelUpdater.resolveTarget(org.cytoscape.model.CyNetwork, org.cy3sbml.SBMLManager)) and submits it as the render executor's key: several Cytoscape events fired while loading one model can resolve to the same target (e.g. a model's subnetworks, taken current in turn, share oneSBMLDocument), andLatestTaskExecutorcoalesces a resubmission of the target it is already rendering rather than cancelling and restarting it, so one load renders once. -
close
public void close()Stops the render executor. Called fromCyActivator.shutDownso the daemon render thread and any in-flight web-service call are stopped on app shutdown.
-