Top Inners Fields Constructors Methods
org.apache.pdfbox.debugger.streampane

public Class StreamPane

extends Object
implements ActionListener
Class Inheritance
All Implemented Interfaces
java.awt.event.ActionListener, java.util.EventListener
Imports
java.awt.Color, .Dimension, .FlowLayout, java.awt.event.ActionEvent, .ActionListener, java.awt.image.BufferedImage, java.io.ByteArrayOutputStream, .IOException, .InputStream, .StringWriter, java.nio.charset.StandardCharsets, java.util.List, .Map, java.util.concurrent.ExecutionException, javax.swing.BoxLayout, .JComboBox, .JComponent, .JOptionPane, .JPanel, .JTabbedPane, .SwingWorker, javax.swing.text.BadLocationException, .DefaultStyledDocument, .Style, .StyleConstants, .StyleContext, .StyledDocument, javax.xml.XMLConstants, javax.xml.transform.OutputKeys, .Transformer, .TransformerException, .TransformerFactory, .TransformerFactoryConfigurationError, javax.xml.transform.dom.DOMSource, javax.xml.transform.stream.StreamResult, org.apache.commons.logging.Log, .LogFactory, org.apache.pdfbox.contentstream.operator.Operator, .OperatorName, org.apache.pdfbox.cos.COSArray, .COSBase, .COSBoolean, .COSDictionary, .COSFloat, .COSName, .COSNull, .COSNumber, .COSStream, .COSString, org.apache.pdfbox.debugger.hexviewer.HexView, org.apache.pdfbox.debugger.streampane.tooltip.ToolTipController, org.apache.pdfbox.io.IOUtils, org.apache.pdfbox.pdfparser.PDFStreamParser, org.apache.pdfbox.pdmodel.PDResources, org.apache.pdfbox.util.XMLUtil, org.w3c.dom.Document

Author
Khyrul Bashar A class that shows the COSStream.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
StreamPane.DocumentCreator

A SwingWorker extended class that convert the stream to text loads in a document.

Field Summary

Modifier and TypeField and Description
private static final StyleContext
private static final Style
private final HexView
private static final Style
private static final Log
private static final Style
private final StreamPaneView
private static final Style
private static final Style
private final JPanel
private final StreamPaneView
private PDResources
private final Stream
private static final Style
private final JTabbedPane
private ToolTipController

Constructor Summary

AccessConstructor and Description
public
StreamPane(COSStream
COSStream instance.
cosStream
,
boolean
boolean instance. This says if a stream is content stream or not.
isContentStream
,
boolean
This says if a stream is an thumbnail image or not.
isThumb
,
COSDictionary
COSDictionary instance that holds the resource dictionary for the stream.
resourcesDic
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
actionPerformed(ActionEvent
the event to be processed
actionEvent
)

Implements java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

private JPanel
createHeaderPanel(List<String> availableFilters, String i, ActionListener actionListener)

public JComponent
private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONTEXTback to summary
private static final StyleContext CONTEXT
ESCAPE_STYLEback to summary
private static final Style ESCAPE_STYLE
hexViewback to summary
private final HexView hexView
INLINE_IMAGE_STYLEback to summary
private static final Style INLINE_IMAGE_STYLE
LOGback to summary
private static final Log LOG
NAME_STYLEback to summary
private static final Style NAME_STYLE
niceViewback to summary
private final StreamPaneView niceView
NUMBER_STYLEback to summary
private static final Style NUMBER_STYLE
OPERATOR_STYLEback to summary
private static final Style OPERATOR_STYLE
panelback to summary
private final JPanel panel
rawViewback to summary
private final StreamPaneView rawView
resourcesback to summary
private PDResources resources
streamback to summary
private final Stream stream
STRING_STYLEback to summary
private static final Style STRING_STYLE
tabbedPaneback to summary
private final JTabbedPane tabbedPane
tTControllerback to summary
private ToolTipController tTController

Constructor Detail

StreamPaneback to summary
public StreamPane(COSStream cosStream, boolean isContentStream, boolean isThumb, COSDictionary resourcesDic) throws IOException

Constructor.

Parameters
cosStream:COSStream

COSStream instance.

isContentStream:boolean

boolean instance. This says if a stream is content stream or not.

isThumb:boolean

This says if a stream is an thumbnail image or not.

resourcesDic:COSDictionary

COSDictionary instance that holds the resource dictionary for the stream.

Exceptions
IOException:
if there is an I/O error during internal data transfer.

Method Detail

actionPerformedback to summary
public void actionPerformed(ActionEvent actionEvent)

Implements java.awt.event.ActionListener.actionPerformed.

Doc from java.awt.event.ActionListener.actionPerformed.

Invoked when an action occurs.

Parameters
actionEvent:ActionEvent

the event to be processed

Annotations
@Override
createHeaderPanelback to summary
private JPanel createHeaderPanel(List<String> availableFilters, String i, ActionListener actionListener)
getPanelback to summary
public JComponent getPanel()
requestImageShowingback to summary
private void requestImageShowing()
requestStreamTextback to summary
private void requestStreamText(String command) throws IOException
org.apache.pdfbox.debugger.streampane back to summary

private final Class StreamPane.DocumentCreator

extends SwingWorker<StyledDocument, Integer>
Class Inheritance

A SwingWorker extended class that convert the stream to text loads in a document.

Field Summary

Modifier and TypeField and Description
private final String
private int
private boolean
private final boolean
private final StreamPaneView

Constructor Summary

AccessConstructor and Description
private
DocumentCreator(StreamPaneView targetView, String filterKey, boolean nice)

Method Summary

Modifier and TypeMethod and Description
private void
protected StyledDocument
doInBackground()

Implements abstract javax.swing.SwingWorker.doInBackground.

Computes a result, or throws an exception if unable to do so.

protected void
done()

Overrides javax.swing.SwingWorker.done.

Executed on the Event Dispatch Thread after the doInBackground method is finished.

private StyledDocument
private StyledDocument
getDocument(InputStream inputStream, String encoding)

private String
private StyledDocument
pack-priv void
private void
private void
Inherited from javax.swing.SwingWorker:
addPropertyChangeListenercancelexecutefirePropertyChangegetgetgetProgressgetPropertyChangeSupportgetStateisCancelledisDoneprocesspublishremovePropertyChangeListenerrunsetProgress

Field Detail

filterKeyback to summary
private final String filterKey
indentback to summary
private int indent
needIndentback to summary
private boolean needIndent
niceback to summary
private final boolean nice
targetViewback to summary
private final StreamPaneView targetView

Constructor Detail

DocumentCreatorback to summary
private DocumentCreator(StreamPaneView targetView, String filterKey, boolean nice)

Method Detail

addOperatorsback to summary
private void addOperators(Object obj, StyledDocument docu) throws BadLocationException
doInBackgroundback to summary
protected StyledDocument doInBackground()

Implements abstract javax.swing.SwingWorker.doInBackground.

Doc from javax.swing.SwingWorker.doInBackground.

Computes a result, or throws an exception if unable to do so.

Note that this method is executed only once.

Note

this method is executed in a background thread.

Returns:StyledDocument

the computed result

Annotations
@Override
doneback to summary
protected void done()

Overrides javax.swing.SwingWorker.done.

Doc from javax.swing.SwingWorker.done.

Executed on the Event Dispatch Thread after the doInBackground method is finished. The default implementation does nothing. Subclasses may override this method to perform completion actions on the Event Dispatch Thread. Note that you can query status inside the implementation of this method to determine the result of this task or whether this task has been cancelled.

Annotations
@Override
getContentStreamDocumentback to summary
private StyledDocument getContentStreamDocument(InputStream inputStream)
getDocumentback to summary
private StyledDocument getDocument(InputStream inputStream, String encoding)
getStringOfStreamback to summary
private String getStringOfStream(InputStream in, String encoding)
getXMLDocumentback to summary
private StyledDocument getXMLDocument(InputStream inputStream)
writeIndentback to summary
pack-priv void writeIndent(StyledDocument docu) throws BadLocationException
writeOperandback to summary
private void writeOperand(Object obj, StyledDocument docu) throws BadLocationException
writeTokenback to summary
private void writeToken(Object obj, StyledDocument docu)