Interface SmileUtilities
public interface SmileUtilities
A collection of utility methods primarily for performing common GUI-related tasks.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic intgetLineOfOffset(JTextComponent editor, int offset) Returns the line number given a text offset.static intgetOffsetOfLine(JTextComponent editor, int line) Returns the start offset of a line.static StringgetWordAt(JTextComponent editor, int offset) Returns the word ending at the text offset.static ImageIconscaleImageIcon(ImageIcon icon, int size) Scales an image icon to desired size.static JFrameShows the data frame in a window.static JFrameShows the data frame in a window.static JFrameShows the figure in a window.static JFrameshow(MultiFigurePane figure) Shows the figure in a window.static JFrameShows the matrix in a window.static JFrameShows the matrix in a window.static JFrameshow(SparseMatrix matrix) Shows the sparse matrix structure in a figure window.
-
Method Details
-
getLineOfOffset
Returns the line number given a text offset.- Parameters:
editor- the text component.offset- the text offset.- Returns:
- the line number.
-
getOffsetOfLine
Returns the start offset of a line.- Parameters:
editor- the text component.line- the line number.- Returns:
- the start offset.
-
getWordAt
Returns the word ending at the text offset.- Parameters:
editor- the text component.offset- the text offset.- Returns:
- the word ending at the text offset.
- Throws:
BadLocationException- if the offset is invalid.
-
scaleImageIcon
-
show
-
show
Shows the figure in a window.- Parameters:
figure- the figure to display.- Returns:
- a new JFrame that contains the figure.
-
show
-
show
-
show
-
show
-
show
Shows the sparse matrix structure in a figure window.- Parameters:
matrix- the matrix to display.- Returns:
- a new JFrame that displays the sparse matrix structure.
-