From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:28:55 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>BG_ChartView</name> <environment>UI</environment> <super>Graphics.DependentComposite</super> <private>false</private> none optionalBlock plotArea elementLooks widgetState <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_ChartView
This class is an abstract class for creating a chart. Instance Variables: optionalBlock <BlockClosure> for displaying the user optional images (ex. lead-lines and special legend). The optionalBlock has two arguments. First arg is the receiver and second is a GraphicsContext on which the receiver displays. plotArea <Rectangle | nil> relative area for displaying mail part of the receiver. elementLooks <OrderedCollection of: LookPreferences> widgetState <WidgetState> Class Variables: LooksForLines <Array of: BG_ChartElementLook> line type preferences. LooksForMarkers <Array of: BG_ChartElementLook> marker type preferences. LooksForRegions <Array of: BG_ChartElementLook> region type preferences.
</comment> <class> <name>BG_GriddedChartView</name> <environment>UI</environment> <super>UI.BG_ChartView</super> <private>false</private> none dataStyle dataLocation labels legend legendFrame legendLocation grid sortedIndex other descriptors <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_GriddedChartView
This class is an abstract class for creating a grid chart. Instance Variables: dataStyle <BG_LabelList> plot values and its attributes. dataLocation <Symbol> position at which data are displayed. labels <OrderedCollection> collection of label string. legend <BG_LabelList> collection of legend label string and its attributes. legendFrame <Wrapper> legend frame and its attributes. legendLocation <Integer> position at which legend are displayed. grid <BG_ChartGrid> transformation for plotting values on the receiver. sortedIndex <Array> private variable to sort data. other <String> or nil. The receiver sorts data in descent order except a label specified by 'other'. If 'other' is nil, then data are not sorted. descriptors <OrderedCollection of: BG_ChartDataSetDescription> collection of data descriptions
</comment> <class> <name>BG_ChartScale</name> <environment>UI</environment> <super>Core.Object</super> <private>false</private> none sourceMin sourceMax destMin destMax step zero increase div <imports></imports> <category>Business Graphics-Scales</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_ChartScale
BG_ChartScale represents a part of linear scaler to translate a value from source coodinates (sc) to destination coodinates (dc). applyTo: aSourceValue answer translated value in dc. applyInverseTo: aDestinationValue answer translated value in sc. Instance Variables: sourceMin <Number> minimum value in sc. sourceMax <Number> maximum value in sc. (> sourceMin) destMin <Number> minimum value in dc. destMax <Number> maximum value in dc. (> destMin) step <Number> interval (in sc) represents receiver's major division (> 0). zero <Number> original value to count step in sc. increase <Boolean> flag to answer true when source value increases, destination value increases. div <Integer> step / div (in sc) represents receiver's minor division (>= 1).
</comment> <class> <name>BG_BarChartView</name> <environment>UI</environment> <super>UI.BG_GriddedChartView</super> <private>false</private> none barWidth barOverlap <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_BarChartView
Instances are for creating a bar chart. Instance Variables: barWidth <Float> the relative width of bar (0.0 - 1.0) barOverlap <Float> the degree to which overlap bars cover each other. (.. - 1.0)
</comment> <class> <name>BG_StackedBarChartView</name> <environment>UI</environment> <super>UI.BG_BarChartView</super> <private>false</private> none showLink <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_StackedBarChartView
Instances are for creating a stacked bar chart. Instance Variables: showLink <Boolean> flag represents whether the receiver shows lines that link together stack.
</comment> <class> <name>BG_BandChartView</name> <environment>UI</environment> <super>UI.BG_StackedBarChartView</super> <private>false</private> none rates <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_BandChartView
Instances are for creating a band chart. Instance Variables: rates <BG_TableAdaptor> quantitative data in percents
</comment> <class> <name>BG_ChartElement</name> <environment>UI</environment> <super>Graphics.GeometricWrapper</super> <private>false</private> none stroke fill lineWidth shadowOffset <imports></imports> <category>Business Graphics-Support</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_ChartElement
BG_ChartElement is used to render and specify the appearence of any geometric appearing in a chart such as a line, bar, or arc. Instance Variables: fill <Boolean> fill component if true and component may be filled. lineWidth <SmallInteger | nil> width of the line used for rendering component. shadowOffset <Point> extent a shadow will be drawn from component. stroke <Boolean> draw component outline if true. Class Variables: Patterns <OrderedCollection of: ByteArray> bit pattern choices to mask or fill element images ShadeMaker <OrderedDither> halftone to shade elements
</comment> <class> <name>BG_ChartDataSetDescription</name> <environment>UI</environment> <super>Core.Object</super> <private>false</private> none adaptor hasData name foregroundColor backgroundColor pattern markerType lineType lineWidth <imports></imports> <category>Business Graphics-Support</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_ChartDataSetDescription
BG_ChartDataSetDescription describes the look of a data series as obtained from a model. See also class ChartElementLookSpec. Instance Variables: adaptor <ValueModel> data model. foregroundColor <ColorValue | nil> color value to use when painting the background of chart elements. backgroundColor <ColorValue | nil> color value to use when painting the foreground of chart elements. hasData <Boolean> if false the adaptor has labels, not data points. lineType <Symbol> one of the following symbols: #default #solid #dotted #dashed #broken #dotted2 #dashed2 #broken2. It describes the line style. lineWidth <SmallInteger> pixel width of lines drawn. markerType <Symbol> one of the following symbols: #square #solidSquare #circle #solidCircle #triangle #solidTrinagle #triangle2 #solidTrinagle2 #diamond #solidDiamond #cross #x. It describes a shape of the marker used in line charts. name <String> name of data series. pattern <Integer> a number describing what kind of mask to use when painting the background of the bar chart elements from this data series.
</comment> <class> <name>BG_ChartGrid</name> <environment>UI</environment> <super>Graphics.VisualPart</super> <private>false</private> none x y transposed <imports></imports> <category>Business Graphics-Scales</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_ChartGrid
Instances are for creating a grid. Instance Variables: x <BG_ChartAxis> x axis y <BG_ChartAxis> y axis transposed <Boolean>
</comment> <class> <name>BG_ChartPolarGrid</name> <environment>UI</environment> <super>UI.BG_ChartGrid</super> <private>false</private> none center xyRate <imports></imports> <category>Business Graphics-Scales</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_ChartPolarGrid
Instances are for creating a polar grid. Instance Variables: center <Point> xyRate <Float>
</comment> <class> <name>BG_Label</name> <environment>UI</environment> <super>Graphics.VisualComponent</super> <private>false</private> none item extent textStyle emphasis decoration format foregroundColor image converter <imports></imports> <category>Business Graphics-Labels</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_Label
Instances provide the support for creating and displaying image of any object with its characteristics such as text style and emphasis. Instance Variables: item <Object | nil> object displayed by the receiver. extent <Point> composition extent. textStyle <TextAttributes> emphasis <Symbol | (Array of: Symbol) | nil> decoration <String | nil> to decorate image of the receiver by replacing its all occurrences of $# with string to which item has been converted by the receiver format <Integer> to format item foregroundColor <ColorValue | nil> image <VisualComponent> for caching the bit representation of the receiver's composed text. Class Variables: FormatConstraint <Dictionary> for checking constraint of formats.
</comment> <class> <name>BG_Banner</name> <environment>UI</environment> <super>UI.BG_Label</super> <private>false</private> none rotation scale isAutoScaled <imports></imports> <category>Business Graphics-Labels</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_Banner
Instances provide the support for creating and displaying scaled and rotated image of the object. Instance Variables: rotation <Integer> rotation angle for displaying object. (0 means unchanged, 1 means clockwise 90 degrees, and so on) scale <Point> magnification/shrinkage for displaying object. isAutoScaled <Boolean> whether the receiver is auto scaled or not
</comment> <class> <name>BG_LineChartView</name> <environment>UI</environment> <super>UI.BG_GriddedChartView</super> <private>false</private> none showMarker showLine <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_LineChartView
Instances are for creating a line chart. Instance Variables: showMarker <Boolean> flag represents whether the receiver shows markers. showLine <Integer> which type lines are shown.
</comment> <class> <name>BG_StepChartView</name> <environment>UI</environment> <super>UI.BG_LineChartView</super> <private>false</private> none <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_StepChartView
Instances are for creating a step line chart.
</comment> <class> <name>BG_LabelList</name> <environment>UI</environment> <super>UI.BG_Label</super> <private>false</private> none column individualImages individualExtent <imports></imports> <category>Business Graphics-Labels</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_LabelList
Instances provide a more efficient representation of lists. The receiver's item must be kind of SequenceableCollection. Instance Variables: column <Integer> number of column individualImages <Array> contains image of each element of item individualExtent <Point> composition extent of each image
</comment> <class> <name>ChartElementLookSpec</name> <environment>UI</environment> <super>UI.SubSpec</super> <private>false</private> none foregroundColor backgroundColor pattern markerType lineType lineWidth <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.ChartElementLookSpec
An sub specification, ChartElementLookSpec describes the look of a data series of the business chart. Instance variables: backgroundColor <ColorValue> color value to use when painting the background of chart elements from this data series foregroundColor <ColorValue> color value to use when painting the foreground of chart elements from this data series lineType <Symbol> one of the following symbols: #default #solid #dotted #dashed #broken #dotted2 #dashed2 #broken2. It describes the line style. lineWidth <Integer> markerType <Symbol> one of the following symbols: #square #solidSquare #circle #solidCircle #triangle #solidTrinagle #triangle2 #solidTrinagle2 #diamond #solidDiamond #cross #x. it describes a shape of the marker used in line charts pattern <Integer> a number describing what kind of mask to use when painting the background of the bar chart elements from this data series.
</comment> <class> <name>BG_Chart1</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none data <imports></imports> <category>Business Graphics-Examples</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> Examples.BG_Chart1
Instances is an example that contains a very simple bar chart and an action button. Hitting the button changes the chart's underlying data, causing the length of the bars to change as well. Instance Variables: data <List> the chart's data
</comment> <class> <name>ChartingScaleSpec</name> <environment>UI</environment> <super>UI.SubSpec</super> <private>false</private> none min max step zero base minorDivisions scaleType autoScale invert restrictions <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.ChartingScaleSpec
ChartingScaleSpec describes the basic properties of the charting scale. Instance variables: autoScale <Boolean> determines whether the scale is set by the user or computed by the view min <Number> minimum value in source coordinates. max <Number> maximum value in source coordinates. (> sourceMin) step <Number> the interval which represents the major division (> 0). zero <Number> the starting value of count steps invert <Boolean> false if source and destination increase in the same direction minorDivisions <Integer> number of minor divisions by step base <Number> base of logarithmic scale scaleType <Symbol> determines weather the scale is linear or logarithmic restrictions <Set of: Symbol> some charts cannot accept all scale types. See the ChartView>>setDataScaleRestrictions: method and its senders.
</comment> <class> <name>BG_EzChart</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none <imports></imports> <category>Business Graphics-Examples</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> Examples.BG_EzChart
Instances display a simple bar chart. Two interface specs are provided: windowSpec uses one data series only and windowSpec2 uses two data series and labels.
</comment> <class> <name>BarChartOptionsSpec</name> <environment>UI</environment> <super>UI.SubSpec</super> <private>false</private> none overlap width dataLocation picture unit showLink <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BarChartOptionsSpec
A sub specification which describes optional parameters for all kinds of bar charts. Instance variables: overlap <Number> defines the degree of the bar overlap, 0 to 1. width <Number> defines the relative width of the bar, 0 to 1. dataLocation <#none | #inside | #outside> defines how data is shown. e.g. #inside means inside the bar. picture <Symbol> defines the aspect that provides the image from the application model unit <Number> defines the picture's unit showLink <Boolean> controls the appearance of a link line connecting data in Stacked Bar charts and Band Charts.
</comment> <class> <name>BG_ChartAxis</name> <environment>UI</environment> <super>Core.Object</super> <private>false</private> none scale isAutoScaled title unit labels labelsMarkAt isAutoLabeled majorTick minorTick axisLine borderLine sectionLine sectionMarkAt tickPosition <imports></imports> <category>Business Graphics-Scales</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_ChartAxis
I hold a scale and some variables which is needed when the receiver is displayed as an axis. However, I don't know how to display myself. The Methods for displaying the axis is defined in an object which refers to me. Instance Variables: scale <BG_ChartScale> my scale isAutoScaled <Boolean> answer true if the receiver sets axis scale automatically. title <BG_Banner> axis title label and its attributes. unit <BG_Label> axis unit label and its attributes. labels <BG_LabelList> axis labels and its attributes. labelsMarkAt <Symbol> message selector to find out positions at which labels are displayed. (ex. #majorMarks, #divisionMarks, #edgeMarks, #zeroMarks) isAutoLabeled <Boolean> answer true if the receiver sets axis labels automatically from the receiver's labelMarks. majorTick <BG_ChartElement> a line minorTick <BG_ChartElement> a line axisLine <BG_ChartElement> a line borderLine <BG_ChartElement> a line sectionLine <BG_ChartElement> a line sectionMarkAt <Symbol> message selector to find out positions at which section lines are displayed. tickPosition <#hide|#cross|#inside|#outside>
</comment> <class> <name>ChartViewSpec</name> <environment>UI</environment> <super>UI.WidgetSpec</super> <private>false</private> none chartType dataLocation orientation dataSeries options xAxis xDataAxis yAxis legendPosition <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.ChartViewSpec
ChartViewSpec describes a component that is an instance of one of the ChartView classes. Possible chart types are: Bar, Pareto, Picture, Stacked Bar, Band, Layer, Line, StackedLine, Step, X, Pie. The model for this view is an indexable collection of objects. An access path for each data series is described in the 'dataSeries' instance variable. Instance variables: chartType <Symbol> dataLocation <Symbol> describes where and if the numeric data is shown on the chart view. orientation <Symbol> determines weather a chart transposed or not dataSeries <ChartDataSpec> definition of data series options <*ChartOptionsSpec> chart options xAxis <ChartingAxisSpec> item axis xDataAxis <ChartingValueAxisSpec> x axis for XY charts yAxis <ChartingValueAxisSpec> data axis legendPosition <Number> describes where and if the legend is shown. Class variables: ChartTypes <Dictionary> Contains chart properties; see ChartViewSpec class>>initalize method.
</comment> <class> <name>BG_LayerChartView</name> <environment>UI</environment> <super>UI.BG_StackedBarChartView</super> <private>false</private> none <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_LayerChartView
Instances are for creating a layer chart.
</comment> <class> <name>ChartDataSetSpec</name> <environment>UI</environment> <super>UI.SubSpec</super> <private>false</private> none aspect isData name look isComputed <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.ChartDataSetSpec
ChartDataSetSpec is a sub specification describing access paths for a data series. It also describes the look (appearance) of the data series. Instance variables: aspect <Symbol> a path for a data series. isComputed <Boolean> if true, an aspect message is sent to the application model which answers a two argument block. This block is used as a get block while constructing table adaptor. isData <Boolean> if false the series describes labels, not data points. look <ChartElementLookSpec> the appearance of the data series name <String> name of the data series. This name is used in the chart legend.
</comment> <class> <name>BG_SalesItem</name> <environment>Examples</environment> <super>Core.Object</super> <private>false</private> none salesHP salesMac salesRS salesSun salesWin month <imports></imports> <category>Business Graphics-Examples</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> Examples.BG_SalesItem
Instances represent sales by platforms for a particular month. Instance Variables: month <String> a month name salesHP <Number> a number of boxes sold on HP platform salesWin <Number> a number of boxes sold on Windows platform salesMac <Number> a number of boxes sold on Mac platform salesSun <Number> a number of boxes sold on Sun platform salesRS <Number> a number of boxes sold on RS6000 platform
</comment> <class> <name>BG_ChartLogScale</name> <environment>UI</environment> <super>UI.BG_ChartScale</super> <private>false</private> none base <imports></imports> <category>Business Graphics-Scales</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_ChartLogScale
Instances represent a part of logarithmic scaler. Instance Variables: base <Number> base of logarithmic scale
</comment> <class> <name>BG_StockTool</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none quotes stocks data chartView <imports></imports> <category>Business Graphics-Examples</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> Examples.BG_StockTool
A simple stock tool. Consists of a list view and a line chart. When the user selects a stock symbol in the list view, the chart displays values for the selected stock. Use the 'Load data...' menu pick to load quotes. Instance Variables: quotes <OrderedCollection of: BG_StockQuote> contains stock quotes. stocks <SelectionInList> the list contains symbols of stocks present in quotes. data <ValueHolder on: (OrderedCollection of: BG_StockQuote)> holds the selected quotes chartView <BG_LineChartView> the chart widget
</comment> <class> <name>BG_StockQuote</name> <environment>Examples</environment> <super>Core.Object</super> <private>false</private> none symbol date price <imports></imports> <category>Business Graphics-Examples</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> Examples.BG_StockQuote
Instances are a simple stock quote representing date of quote, stock value, and stock symbol. Instance Variables: date <Date> date of quote. price <Float> the stock value symbol <String> the stock symbol
</comment> <class> <name>BG_Sales</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none sales <imports></imports> <category>Business Graphics-Examples</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> Examples.BG_Sales
Instances illustrate a simple line chart that uses two data series. Instance Variables: sales <List of: BG_SalesItem> the sales data
</comment> <class> <name>BG_PieChartView</name> <environment>UI</environment> <super>UI.BG_GriddedChartView</super> <private>false</private> none isEllipse rates explode doughnutLabel sortSlices <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_PieChartView
Instances are for creating a pie chart. Instance Variables: isEllipse <Boolean> flag to find out the receiver's shape. if 'isEllipse' is true, the shape is ellipse, otherwise circle. rates <BG_TableAdaptor of: SequenceableCollection> quantitative data in percents. explode <Array of: String> collection of label which a slice is emphasized. doughnutLabel <BG_Label> a label for center sortSlices <Boolean>
</comment> <class> <name>BG_DataPointMarker</name> <environment>UI</environment> <super>Graphics.VisualComponent</super> <private>false</private> none borderImage internalImage path <imports></imports> <category>Business Graphics-Support</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_DataPointMarker
Instances of BG_DataPointMarker display a bordered geometric symbol or user defined image as a data point marker. Instance Variables: borderImage <BG_Label | CachedImage> visual for marker border. internalImage <BG_Label | CachedImage> visual for marker interior. path <Geometric> alternate marker geometric to be displayed if graphics medium is not a Screen. Class Variables: NamedMarkers <IdentityDictionary of: BG_DataPointMarker> common markers identified by name symbol
</comment> <class> <name>BG_Employee</name> <environment>Examples</environment> <super>Core.Object</super> <private>false</private> none name age salary <imports></imports> <category>Business Graphics-Examples</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> Examples.BG_Employee
Instances describe employees in terms of the employee's name, age, and salary. Instance Variables: name <String> employee's name age <Number> employee's age salary <Number> employee's salary
</comment> <class> <name>ChartingAxisSpec</name> <environment>UI</environment> <super>UI.SubSpec</super> <private>false</private> none scale title unit tickPosition axisLine borderLine sectionLine sectionMarkAt <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.ChartingAxisSpec
ChartingAxisSpec describes the basic properties of a chart axis. Note that this spec describes strictly the properties of axis. It is the job of ChartingScaleSpec to describe the properties of the chart scale. Instance variables: axisLine <Boolean> determines whether to show or hide an axis line borderLine <Boolean> determines whether to show or hide a border line scale <ChartingScaleSpec> scale description sectionLine <Boolean> determines whether to show or hide section lines sectionMarkAt <Symbol> Area to draw the section lines. A symbol is one of the following: #none #majorMarks #minorMarks #divisionMarks #edgeMarks #zeroMarks tickPosition <Symbol> Determines where to draw the ticks, and if the ticks should be drawn. title <String> The title of the axis. If the string starts with: $# then it is treated as symbol and is sent to the application model, which provides a real title. unit <String> a unit used for this axis. If the string starts with: $# then it is treated as symbol and is sent to the application model, which provides a real unit.
</comment> <class> <name>BG_TextLabel</name> <environment>UI</environment> <super>UI.Label</super> <private>false</private> none <imports> private Smalltalk.TextConstants.* </imports> <category>Business Graphics-Labels</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_TextLabel
This class specializes Label to add any protocol Charts might find convenient.
</comment> <class> <name>BG_XYChartView</name> <environment>UI</environment> <super>UI.BG_LineChartView</super> <private>false</private> none <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_XYChartView
Instances are for creating a XY (scatter) chart.
</comment> <class> <name>BG_TableAdaptor</name> <environment>UI</environment> <super>Core.ArrayedCollection</super> <private>false</private> none dependents baseCollection adaptors <imports></imports> <category>Business Graphics-Support</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_TableAdaptor
BG_TableAdaptor is used to provide two-dimensional data access to a collection of records for a SelectionInList. The data records (which provide the basis for the rows of the table) are held in a SequenceableCollection and accessed using a RowAdaptor. If the size of the table is to be changed dynamically, the data records should be held in a List or OrderedCollection. The difference between TableAdaptor and BG_TableAdaptor is the collection determines number of rows. Instance Variables: dependents <Object | nil> Typically this is the BG_ChartView served by the BG_TableAdaptor baseCollection <ArrayedCollection> A collection of records which will be presented one per row adaptors <Collection of: BG_ChartDataSetDescriptions> An n-tuple of getBlock, putBlock pairs for adapting arbitrary aspects of the records
</comment> <class> <name>ChartScaleSpecModel</name> <environment>Tools</environment> <super>Tools.SpecModel</super> <private>false</private> none min max zero minorDivisions base step autoScale scaleType invert <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <class> <name>BG_ParatoChartView</name> <environment>UI</environment> <super>UI.BG_BarChartView</super> <private>false</private> none auxGrid <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_ParatoChartView
Instance are for creating a parato chart. Instance Variables: auxGrid <BG_ChartGrid> only y axis used for displaying percentage value
</comment> <class> <name>ChartDataSpecModel</name> <environment>Tools</environment> <super>Tools.SpecModel</super> <private>false</private> none seriesName seriesAspect isLabel selectedIndex selectedSeries menuHolder isComputed <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <class> <name>BG_Company</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none employees <imports></imports> <category>Business Graphics-Examples</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> Examples.BG_Company
Instances are a simple example illustrating the use of data series. It displays the information (salary and age of employees) as a line chart. Instance Variables: employees <List> a collection of the company's employees
</comment> <class> <name>BG_ChartElementLook</name> <environment>UI</environment> <super>UI.LookPreferences</super> <private>false</private> none marker lineWidth lineStyle fillMask <imports></imports> <category>Business Graphics-Support</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_ChartElementLook
Instances provided a specialized LookPreferences for Business Graphic charts so that there is control over properties of a Chart view, e.g. line width, line type. Instance Variables: marker <Symbol | VisualComponent> lineWidth <Integer> lineStyle < nil | (ByteArray of: Integer)> fillMask <Image | nil>
</comment> <class> <name>BG_StackedLineChartView</name> <environment>UI</environment> <super>UI.BG_LineChartView</super> <private>false</private> none <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_StackedLineChartView
Instances are for creating a stacked line chart.
</comment> <class> <name>LineChartOptionsSpec</name> <environment>UI</environment> <super>UI.SubSpec</super> <private>false</private> none showMarker showLine dataLocation spline <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.LineChartOptionsSpec
LineChartOptionsSpec is a sub specification which describes the optional parameters for all types of line charts. Instance variables: dataLocation <#show | #hide> determines whether to show data in the chart view or not. showLine <Boolean> determines whether to show lines in the chart view or not showMarker <Boolean> determines whether to show markers in the chart view or not spline <Boolean> if true then chart view will use splines
</comment> <class> <name>ChartDataSpec</name> <environment>UI</environment> <super>UI.SubSpec</super> <private>false</private> none series <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.ChartDataSpec
A sub specification, ChartDataSpec describes the data series of the business chart. It holds a collection of sub specifications describing single data sets. Instance variables: series <Array of: ChartDataSetSpec> contains a definition of the data series
</comment> <class> <name>BG_PictureChartView</name> <environment>UI</environment> <super>UI.BG_BarChartView</super> <private>false</private> none picture unit <imports></imports> <category>Business Graphics-Charts</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_PictureChartView
Instances are for creating a picture bar (unit) chart. Instance Variables: picture <BG_Banner> the form and its attributes. unit <Number> value per one picture.
</comment> <class> <name>ChartingValueAxisSpec</name> <environment>UI</environment> <super>UI.ChartingAxisSpec</super> <private>false</private> none labelsMarkAt labelFormat <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.ChartingValueAxisSpec
ChartingValueAxisSpec describes the properties of a chart data axis. It adds to the ChartingAxisSpec positioning labels and label formatting. Instance variables: labelFormat <Symbol> the format of labels. One of the following symbols is used: #general #asterisk #comma #float #percent labelsMarkAt <Symbol> the position of labels. One of the following symbols is used: #none #majorMarks #minorMarks #divisionMarks #edgeMarks #zeroMarks
</comment> <class> <name>BG_IconicLabel</name> <environment>UI</environment> <super>UI.BG_Label</super> <private>false</private> none icon mode gap <imports></imports> <category>Business Graphics-Labels</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.BG_IconicLabel
Instances represents a label with an icon. Instance Variables: icon <VisualComponent> the "Icon". mode <Integer> display mode of the receiver. (0: icon left 1: label left 2: icon only 3: label only 4: icon top 5: label top) gap <Integer> interval icon and label when the receiver displayed
</comment> <class> <name>PieChartOptionsSpec</name> <environment>UI</environment> <super>UI.SubSpec</super> <private>false</private> none shape explode doughnutLabel showLines dataLocation sortSlices <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> UI.PieChartOptionsSpec
PieChartOptionsSpec is a sub specification which describes optional parameters for pie charts. Instance variables: dataLocation <#dataAdjacent | #dataBelow | #hide> determines whether and where to show data in the chart view. showLines <#show | #hide> determines whether to show lines connecting data in the chart view. doughnutLabel <String> label that is shown in the center of the chart. explode <String> this string is matched against labels of the pie chart. If it matches then the pie is drawn as an exploded pie. shape <Symbol> determines whether the chart is a circle or an ellipse
</comment> <class> <name>ChartColorTool</name> <environment>Tools</environment> <super>UI.SimpleDialog</super> <private>false</private> none cubesBrightness cubeColors colorValue lookPreferences <imports></imports> <category>Business Graphics-Specifications</category> <attributes> <package>BGOK</package> </attributes> </class> <comment> Tools.ChartColorTool
ChartColorTool is used to assign, display and edit the color policies governing the appearance of data series displayed in a ChartView. Colors can be generated for use in color policies using either the color cube, a rectangular color map display which includes a brightness slider, or an HSV triplet of analog sliders, or a menu of named colors. The color cube gives decent but not exhaustive coverage of the available colors in the Screen palette; the sliders can sometimes turn up a few more. The Hue slider will appear only when the Saturation slider is not zeroed; similarly the Saturation slider will appear only when the Value slider is not zeroed. The menu of named colors can be summoned by pressing the select mouse button while the cursor is inside the color patch underneath the sliders. Once a color has been selected either by pointing into the color cube, moving the sliders, or selecting a named color, it can be moved to the appropriate display patch at the bottom of the tool by clicking on the policy color patch. Instance Variables: cubesBrightness <ValueHolder with: ColorValue> Brightness setting for the color cube cubeColors <OrderedCollection of: ValueHolder on: ColorValue> The value holders behind the 'paint chips' in the color cube colorValue <ValueHolder on: ColorValue> The color in the master color patch under the sliders lookPreferences <LookPreferences> The current settings of all four policy colors
</comment> <name>LooksForMarkers</name> <environment>UI.BG_ChartView</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>BGOK</package> </attributes> <name>LooksForRegions</name> <environment>UI.BG_ChartView</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>BGOK</package> </attributes> <name>LooksForLines</name> <environment>UI.BG_ChartView</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>BGOK</package> </attributes> <name>Patterns</name> <environment>UI.BG_ChartElement</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>BGOK</package> </attributes> <name>ShadeMaker</name> <environment>UI.BG_ChartElement</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>BGOK</package> </attributes> <name>FormatConstraint</name> <environment>UI.BG_Label</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>BGOK</package> </attributes> <name>NamedMarkers</name> <environment>UI.BG_DataPointMarker</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>BGOK</package> </attributes> <name>ChartTypes</name> <environment>UI.ChartViewSpec</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>BGOK</package> </attributes> <methods> UI.BG_ChartView <category>color/mask/line/marker</category>
chartLookList ^LooksForRegions
chartLookListAt: anIndex "Access saftly a collection of looks" | collection i | collection := self chartLookList. i := anIndex. i > collection size ifTrue: [i := i \\ collection size. i = 0 ifTrue: [i := collection size]]. ^collection at: i
colors: collectionOfColorValues | list lookPreference color | list := collectionOfColorValues asArray. self composeLooks: list size. 1 to: list size do: [:i | lookPreference := (self looksAt: i) copy. color := list at: i. color isNil ifFalse: [color isInteger ifTrue: [color := (self chartLookListAt: color) backgroundColor]. lookPreference setBackgroundColor: color. elementLooks at: i put: lookPreference]]
looksAt: index | lookPrefs | index > elementLooks size ifTrue: [^self lookPreferences]. lookPrefs := elementLooks at: index. ^lookPrefs isInteger ifTrue: [self chartLookListAt: lookPrefs] ifFalse: [lookPrefs]
looksType "Answer what kind of looks a chart expects. We distinguish two types: #region for bar and pie charts and #line for line and xy charts" ^#region
masks: collectionOfIntegersOrMasks | list lookPreference mask | list := collectionOfIntegersOrMasks asArray. self composeLooks: list size. 1 to: list size do: [:i | lookPreference := (self looksAt: i) copy. mask := list at: i. mask isNil ifFalse: [mask isInteger ifTrue: [mask := BG_ChartElement patternAt: mask]. lookPreference fillMask: mask. elementLooks at: i put: lookPreference]]
</methods> <methods> UI.BG_ChartView <category>options</category>
optionalBlock ^optionalBlock
optionalBlock: aBlockClosure optionalBlock := aBlockClosure
</methods> <methods> UI.BG_ChartView <category>private</category>
bottomMargin ^0
compose "Do nothing"
composeLooks: size elementLooks size < size ifTrue: [elementLooks := elementLooks asOrderedCollection. elementLooks size + 1 to: size do: [:i | elementLooks add: i]].
getClientDataFor: aGraphicsContext | lp dict chartLook | chartLook := aGraphicsContext clientDataAt: #chartLook ifAbsent: []. chartLook == nil ifFalse: [^chartLook]. lp := self lookPreferences. chartLook := BG_ChartElementLook new. chartLook setForegroundColor: lp foregroundColor; setBackgroundColor: lp backgroundColor. dict := IdentityDictionary new. dict at: #chartElement put: chartLook. aGraphicsContext mergeIntoClientData: dict. aGraphicsContext lineWidth: chartLook lineWidth. aGraphicsContext paint: chartLook foregroundColor. ^chartLook
leftMargin ^0
max: aCollection | res | res := aCollection inject: nil into: [:i :j | i==nil ifTrue: [j] ifFalse: [i max: j]]. ^res isNil ifTrue: [self defaultScaleRange last] ifFalse: [res]
min: aCollection | res | res := aCollection inject: nil into: [:i :j | i == nil ifTrue: [j] ifFalse: [i min: j]]. ^res isNil ifTrue: [self defaultScaleRange first] ifFalse: [res]
rightMargin ^0
setChartElementLookUsing: aGraphicsContext | dict chartLook gc | gc := aGraphicsContext copy. chartLook := aGraphicsContext clientDataAt: #chartElement ifAbsent: [nil]. chartLook == nil ifFalse: [^gc]. chartLook := BG_ChartElementLook from: self lookPreferences. dict := IdentityDictionary new. dict at: #chartElement put: chartLook. gc mergeIntoClientData: dict. gc lineWidth: chartLook lineWidth. chartLook foregroundColor ifNotNil: [:paint | gc paint: paint]. ^gc
setClientDataFor: aGraphicsContext index: index foreground: beForeground | dict chartLook gc | gc := aGraphicsContext copy. chartLook := self looksAt: index. dict := IdentityDictionary new. dict at: #chartElement put: chartLook. gc mergeIntoClientData: dict. gc lineWidth: chartLook lineWidth. beForeground ifTrue: [gc paint: chartLook foregroundColor]. ^gc
sum: aCollection ^aCollection inject: 0 into: [:i :j | i + j]
topMargin ^0
</methods> <methods> UI.BG_ChartView <category>displaying</category>
displayComponentsOn: aGraphicsContext super displayOn: aGraphicsContext
displayOn: aGraphicsContext | gc | self compose. gc := aGraphicsContext copy. gc intersectClip: self bounds. self displayOptionsOn: gc. self displayComponentsOn: aGraphicsContext
displayOptionsOn: aGraphicsContext optionalBlock isNil ifTrue: [^self]. optionalBlock value: self value: aGraphicsContext
</methods> <methods> UI.BG_ChartView <category>bounds accessing</category>
height ^self bounds height
plotArea ^plotArea isNil ifTrue: [self bounds insetOriginBy: self leftMargin @ self topMargin cornerBy: self rightMargin @ self bottomMargin] ifFalse: [plotArea rectangleRelativeTo: self bounds]
plotArea: aLayoutObject plotArea := aLayoutObject
preferredBounds ^Rectangle origin: 0@0 extent: 300@300
width ^self bounds width
</methods> <methods> UI.BG_ChartView <category>model accessing</category>
model: aModel "Set the receiver's model to aModel." self setModel: aModel.
</methods> <methods> UI.BG_ChartView <category>initialize-release</category>
initialize super initialize. self initializeState. elementLooks := OrderedCollection new
initializeState widgetState := WidgetState new.
</methods> <methods> UI.BG_ChartView <category>accessing</category>
widgetState ^widgetState
widgetState: aWidgetState widgetState := aWidgetState
</methods> <methods> UI.BG_ChartView <category>updating</category>
getNewData "Get new data from the model." ^self
</methods> <methods> UI.BG_ChartView <category>private-default-model</category>
defaultScaleRange ^0 to: 100
</methods> <methods> UI.BG_ChartView class <category>private-colors</category>
backgroundColorForIndex: i "Private - used for reagions and lines" | hue saturation brightness | hue := i - 1 \\ 12 / 12 * 4. hue >= 2 ifTrue: [hue := hue - (23 / 12)]. hue >= 1 ifTrue: [hue := hue - (5 / 6)]. saturation := i - 1 // 12 = 1 ifTrue: [0.4] ifFalse: [1]. brightness := i > 24 ifTrue: [0.8] ifFalse: [1]. hue = (1 / 3) ifTrue: [brightness := brightness - 0.2]. ^ColorValue hue: hue saturation: saturation brightness: brightness
</methods> <methods> UI.BG_ChartView class <category>class initialization</category>
initialize "BG_ChartView initialize" self initializeLines. self initializeRegions
initializeLines "BG_ChartView initializeLines" | styles width style look markers | styles := #(solid dotted dashed broken dotted2 dashed2 broken2). markers := #(#square #solidSquare #circle #solidCircle #triangle #solidTriangle #triangle2 #solidTriangle2 #diamond #solidDiamond #cross #x). LooksForLines := Array new: 21. 1 to: 21 do: [:i | width := i-1//7+2. style := i-1\\7+1. look := BG_ChartElementLook new. look setForegroundColor: (self backgroundColorForIndex: i). look setBackgroundColor: ColorValue black. look lineWidth: width. look lineStyle: (BG_ChartElement perform: (styles at: style)). LooksForLines at: i put: look]. LooksForMarkers := Array new: 12. 1 to: 12 do: [:i | look := BG_ChartElementLook new. look setForegroundColor: ColorValue black. look setBackgroundColor: ColorValue white. look lineWidth: 1. look lineStyle: BG_ChartElement solid. look marker: (markers at: i). LooksForMarkers at: i put: look].
initializeRegions "BG_ChartView initializeRegions" | look | LooksForRegions := Array new: 36. 1 to: 36 do: [:i | look := BG_ChartElementLook new. look setForegroundColor: ColorValue black. look setBackgroundColor: (self backgroundColorForIndex: i). look lineWidth: 1. look lineStyle: BG_ChartElement solid. LooksForRegions at: i put: look]
</methods> <methods> UI.BG_GriddedChartView <category>data</category>
data ^dataStyle item
data: collectionOfValues "Make sure that data item is the BG_TableAdaptor." dataStyle item: ((collectionOfValues isKindOf: BG_TableAdaptor) ifTrue: [collectionOfValues] ifFalse: [BG_TableAdaptor withRow: collectionOfValues]).
dataInside dataLocation := #inside
dataLocation ^dataLocation
dataOutside dataLocation := #outside
dataStyle ^dataStyle
hideData dataLocation := #hide
isDataVisible ^dataLocation ~= #hide
isPercentage "Answer true if the receiver displays data labels with values that are a percentage of the total" ^dataStyle formatTypes includes: #percent
isZeroSuppress "Answer true if the receiver does not display data labels when its value is zero" ^dataStyle formatTypes includes: #zerosuppress
</methods> <methods> UI.BG_GriddedChartView <category>model accessing</category>
model: aModel "Set the receiver's model to aModel. Register myself as a dependent of both the model and the model value. If the descriptors are already set recompute the chart's data." super model: aModel. self getNewData
</methods> <methods> UI.BG_GriddedChartView <category>displaying</category>
displayAxisOn: aGraphicsContext | gc | gc := aGraphicsContext copy. grid displayHAxisOn: gc. grid displayVAxisOn: gc. grid displayHLabelsOn: aGraphicsContext. grid displayVLabelsOn: aGraphicsContext
displayDataOn: aGraphicsContext ^self
displayGridLinesOn: aGraphicsContext | gc | gc := aGraphicsContext copy. gc paint: self selectionBackgroundColor. grid displayHLinesOn: gc. grid displayVLinesOn: gc
displayLegendOn: aGraphicsContext | area images iconRect plus gc labelsWidth | gc := self setChartElementLookUsing: aGraphicsContext. legendFrame displayOn: gc. area := legendFrame bounds insetBy: 6. images := legend individualImages. labelsWidth := self isLegendHorizontal ifFalse: [legend individualExtent x] ifTrue: [legend computedExtent x]. iconRect := (area topLeft extent: ((area width - labelsWidth) // legend column) @(area height // legend row)) insetBy: 3. plus := 0@0. 1 to: self legendSize do: [:i | | eachImage rect | eachImage := images at: i. gc := self setClientDataFor: aGraphicsContext index: i foreground: false. self displayLegendSymbol: i in: (rect := iconRect origin + plus extent: iconRect extent) on: gc. plus := plus + (self isLegendHorizontal ifTrue: [(6 + iconRect width + eachImage extent x)@0] ifFalse: [0@(area height // legend row)]). eachImage displayOn: gc at: (rect rightCenter - (-3 @ (eachImage height // 2)))]
displayLegendSymbol: anIndex in: aRectangle on: aGraphicsContext (BG_ChartElement on: aRectangle) displayOn: aGraphicsContext.
displayOn: aGraphicsContext | gc noData fgColor innerGC | self compose. gc := aGraphicsContext copy. "fgColor might not be defined" (fgColor := self lookPreferences foregroundColor) isNil ifFalse: [gc paint: fgColor]. gc intersectClip: self bounds. self displayGridLinesOn: gc. innerGC := grid gcCopyClipped: gc. (noData := self data isNil or: [self data isEmpty]) ifFalse: [self displayPlotOn: innerGC]. self displayAxisOn: gc. noData ifFalse: [self isDataVisible ifTrue: [self displayDataOn: innerGC]. self isLegendVisible ifTrue: [self displayLegendOn: gc]]. self displayOptionsOn: gc
displayPlotOn: aGraphicsContext ^self
</methods> <methods> UI.BG_GriddedChartView <category>private-default-model</category>
defaultDescriptors "Answer a collection of default descriptors" ^self defaultDescriptorsFor: self defaultNbrOfSeries.
defaultDescriptorsFor: numberOfSeries "Answer a collection of default descriptors. When more then one data series is necessary make the descriptors use indexes." | descr nbr | nbr := numberOfSeries isNil ifTrue: [self defaultNbrOfSeries] ifFalse: [numberOfSeries]. descr := Array new: nbr. 1 to: nbr do: [:i | | dd | dd := BG_ChartDataSetDescription new. nbr > 1 ifTrue: [dd adaptor: (IndexedAdaptor forIndex: i)]. dd name: (String with: ($A asInteger - 1 + i) asCharacter). descr at: i put: dd]. ^descr
defaultModelFor: dataDescriptor "Answer a default model for specified data descriptors. The default model is simply an array containing numbers if just one data series is needed, or an list of arrays if more then one data series is requested." | range step val defModel nbr indxes labelIndex columns | nbr := dataDescriptor nbrOfDataSeries. labelIndex := dataDescriptor labelIndex. columns := nbr + (labelIndex = 0 ifTrue: [0] ifFalse: [1]). range := self grid y isAutoScaled ifTrue: [self defaultRange] ifFalse: [self defaultRangeFromScale: self grid y scale andNumberOfSeries: nbr]. step := range last - range first / (self defaultNbrOfPoints + 2). columns > 1 ifTrue: [defModel := List new: self defaultNbrOfPoints. 1 to: self defaultNbrOfPoints do: [:i | defModel at: i put: (Array new: columns)]] ifFalse: [defModel := Array new: self defaultNbrOfPoints]. val := range first + step. "Swap the first and last index inorder to have more interesting model" indxes := Array new: defModel size. 2 to: defModel size do: [:i | indxes at: i put: i]. indxes at: 1 put: defModel size. indxes at: defModel size put: 1. indxes do: [:i | columns > 1 ifTrue: [| row | row := defModel at: i. 1 to: columns do: [:c | c = labelIndex ifFalse: [row at: c put: (self defaultPointFor: val column: c range: range)] ifTrue: [row at: c put: (String with: ($a asInteger - 1 + i) asCharacter)]]] ifFalse: [defModel at: i put: (self defaultPointFor: val column: 1 range: range)]. val := val + step]. ^defModel
defaultNbrOfPoints ^5
defaultNbrOfSeries ^1
defaultPointFor: aValue column: aColumn range: aRange | val | val := (aValue / aColumn min: aRange last) max: aRange first. ^val abs > 2 ifTrue: [val asInteger] ifFalse: [val asFloat]
defaultRange ^10 to: 100
defaultRangeFromScale: aScale andNumberOfSeries: aNumber ^Array with: aScale sourceMin with: aScale sourceMax
useDefaultDescriptors "Set descriptors to the array of default descriptors" | descr | descr := self defaultDescriptorsFor: self defaultNbrOfSeries. self descriptors: descr
</methods> <methods> UI.BG_GriddedChartView <category>legend</category>
hideLegend legendLocation := legendLocation bitAnd: 2r10000
isLegendHorizontal ^self legendAlignment <= 3 or: [self legendAlignment >= 13]
isLegendInside ^legendLocation >= 16
isLegendVisible ^self legendAlignment ~= 0
legend ^legend item
legend: collectionOfStrings legend item: collectionOfStrings
legendAlignment ^legendLocation bitAnd: 2r1111
legendAlignment: anInteger legendLocation := (legendLocation bitAnd: 2r10000) bitOr: (anInteger bitAnd: 2r1111).
legendFrame ^legendFrame
legendInside legendLocation := legendLocation bitOr: 2r10000
legendLocation ^legendLocation
legendLocation: location "locations [4:1] position at which legends ares placed. 0: hide 1: top left 2: top center 3: top right 4: left top 5: center top 6: right top 7: left center 8: center 9: right center 10: left bottom 11: center bottom 12: right bottom 13: bottom left 14: bottom center 15: bottom right [5]: inside/outside of the frame 0: outside 1: inside" legendLocation := location
legendOutside legendLocation := legendLocation bitAnd: 2r01111
legendStyle ^legend
</methods> <methods> UI.BG_GriddedChartView <category>private</category>
bottomMargin ^(self isLegendVisible and: [self legendAlignment >= 13 & self isLegendInside not]) ifTrue: [super bottomMargin + (0.05* self height) rounded] ifFalse: [super bottomMargin]
compose | size | self composeLabels: self labelsSize. (size := self legendSize) = 0 ifFalse: [self composeLooks: size. self composeSortIndex: self sortedValues. self composeGrid. self isLegendVisible ifTrue: [self composeLegend: size]].
composeGrid grid y isAutoScaled & grid y isAutoLabeled ifTrue: [| matrix | matrix := self dataRangeMatrix. grid y scale autoMin: (self min: matrix) max: (self max: matrix)]. grid bounds: self plotArea. self isDataOutside ifTrue: ["Add extra room for displaying data outside the chart." | op cp scale offset doCp doOp | op := 0 @ 0. cp := 0 @ 0. doCp := doOp := false. offset := dataStyle individualExtent + (3 @ 3). scale := grid y scale. scale incrementalScaled ifTrue: [doOp := scale sourceMin < 0. doCp := scale sourceMax >= 0] ifFalse: [doOp := scale sourceMax >= 0. doCp := scale sourceMin < 0]. grid transposed ifTrue: [doCp ifTrue: [cp := offset x @ 0]. doOp ifTrue: [op := offset x @ 0]] ifFalse: [doCp ifTrue: [cp := 0 @ offset y]. doOp ifTrue: [op := 0 @ offset y]]. grid insetBounds: (grid insetBounds insetOriginBy: op cornerBy: cp)]
composeLabels: size labels = grid x labels ifFalse: [grid x labels: labels copy].
composeLegend: size | item | legend item isNil ifTrue: [legend item: (OrderedCollection new: size)]. item := legend item asOrderedCollection. item size < size ifTrue: [item size + 1 to: size do: [:i | item add: nil]. legend item: item]. self composeLegendFrame: size
composeLegendFrame: size | area ie rect rectSym aligns withs delta minFactor| rectSym := #(topLeft topCenter topRight leftCenter center rightCenter bottomLeft bottomCenter bottomRight). aligns := #(7 8 9 3 2 1 6 5 4 9 8 7 1 2 3 1 1 2 3 1 2 3 4 5 6 7 8 9 7 8 9). withs := #(1 2 3 1 2 3 4 5 6 7 8 9 7 8 9). minFactor := 12 * size. ie := legend individualExtent. ie := ie max: 10@10. area := self isLegendInside ifTrue: [grid insetBounds insetBy: 12] ifFalse: [self plotArea]. self isLegendHorizontal ifTrue: [ |w| legend beHorizontal. w := legend computedExtent x. rect := 0@0 extent: ((area width rounded min: 30 + minFactor + w) max: minFactor + w)@(((0.05 * self height) rounded min: 40) max: ie y)] ifFalse: [legend beVertical. rect := 0@0 extent: (((0.15 * self width) rounded min: 30 + ie x) max: 18 + ie x)@(((area height - 24) min: 30 * size) max: ie y * size)]. rect := rect expandedBy: 6. legendFrame component: (rect align: (rect perform: (rectSym at: (aligns at: legendLocation))) with: (area perform: (rectSym at: (withs at: self legendAlignment)))). delta := legendFrame bounds amountToTranslateWithin: (self bounds insetBy: 6). legendFrame component: (legendFrame component translatedBy: delta).
composeSortIndex: sortedValues | order value includes index glabels | value := sortedValues. other isNil ifTrue: [sortedIndex := Array new: value columnSize. 1 to: sortedIndex size do: [:i | sortedIndex at: i put: i]] ifFalse: [includes := false. index := 0. (index := labels indexOf: other ifAbsent: [value columnSize + 1]) <= value columnSize ifTrue: [includes := true]. order := SortedCollection sortBlock: [:a :b | (value at: a@1) > (value at: b@1)]. 1 to: value columnSize do: [:i | order add: i]. order := order asOrderedCollection. includes ifTrue: [order remove: index; addLast: index]. sortedIndex := order asArray. glabels := OrderedCollection new. sortedIndex do: [:n | glabels add: (labels at: n)]. grid x labels: glabels]
dataRangeMatrix ^self data copy
defaultDataAngle ^grid transposed ifTrue: [grid y scale incrementalScaled ifTrue: [0] ifFalse: [180]] ifFalse: [grid y scale incrementalScaled ifTrue: [90] ifFalse: [270]]
isDataOutside ^dataLocation ~= #hide and: [dataLocation ~= #inside]
labelsSize ^self data columnSize
leftMargin ^(self isLegendVisible and: [self legendAlignment \\ 3 = 1 & self isLegendInside not & self isLegendHorizontal not]) ifTrue: [super leftMargin + (0.15* self width) rounded] ifFalse: [super leftMargin]
legendSize ^self data rowSize
rates: values | sum | sum := self sum: values. ^values collect: (sum = 0 ifTrue: [[:n | 0]] ifFalse: [[:n | (n / sum) asFloat]])
rightMargin ^(self isLegendVisible and: [self legendAlignment \\ 3 = 0 & self isLegendInside not & self isLegendHorizontal not]) ifTrue: [super rightMargin + (0.15* self width) rounded] ifFalse: [super rightMargin]
roundedRates: values | percentages sum max | percentages := values collect: [:n | n roundTo: 0.001]. ((sum := self sum: percentages) < 1 and: [percentages isEmpty not]) ifTrue: [max := (self max: percentages). percentages at: (percentages indexOf: max) put: max + (1 - sum)]. ^percentages
sortedValues | value | value := BG_TableAdaptor columns: self data columnSize rows: 1. 1 to: self data columnSize do: [:x | value atPoint: x@1 put: (self data column: x inject: 0 into: [:sum :i | sum+i])]. ^value
topMargin ^(self isLegendVisible and: [self legendAlignment <= 3 & self isLegendInside not]) ifTrue: [super topMargin + (0.05* self height) rounded] ifFalse: [super topMargin]
</methods> <methods> UI.BG_GriddedChartView <category>sorting</category>
other ^other
other: aStringForOther other := aStringForOther
</methods> <methods> UI.BG_GriddedChartView <category>grid</category>
grid ^grid
transpose grid transpose. grid y scale reverse
transposed ^grid transposed
</methods> <methods> UI.BG_GriddedChartView <category>labels</category>
labels ^labels
labels: collectionOfStrings labels := collectionOfStrings. grid x labels: labels copy
labelsStyle ^grid x labelsStyle
</methods> <methods> UI.BG_GriddedChartView <category>private-data-transformation</category>
basicCollection "Answer a basic collection held in dataStyle item." | value | value := self data. ^value notNil ifTrue: [value baseCollection] ifFalse: [nil]
dataFromDescriptions "Charts expect the data to be an instance of BG_TableAdaptor with rows being data sets. Model is a value holder on a collection of objects Descriptors provide brake up into separate data sets. Here we make ourselves dependent on the collection. Note that we have to do transformation of the matrix data." | adaptor dataDescr lbls labelDescr value oldValue | oldValue := self basicCollection. value := (model isKindOf: SelectionInList) ifTrue: [model list] ifFalse: [model value]. oldValue ~~ value ifTrue: [oldValue removeDependent: self. value notNil ifTrue: [value addDependent: self]]. dataDescr := descriptors select: [:descr | descr hasData]. adaptor := BG_TableAdaptor on: value adaptors: (dataDescr collect: [:descr | descr adaptor]). labelDescr := descriptors detect: [:descr | descr hasData not] ifNone: [nil]. lbls := labelDescr notNil ifTrue: [lbls := BG_TableAdaptor on: value adaptors: (Array with: labelDescr adaptor)] ifFalse: [Array new: value size]. self data: adaptor. self legend: (dataDescr collect: [:descr | descr name]). self labels: lbls
lookFromDescriptions "Use the data from descriptors to set up apperance of the chart." | dataDescr | dataDescr := descriptors select: [:descr | descr hasData]. self setChartLooksFrom: dataDescr
setChartLooksFrom: dataDescriptors "Set set a collection of chart element looks" | list | list := dataDescriptors asArray. self composeLooks: list size. 1 to: list size do: [:i | | dd lookPreference | lookPreference := (self looksAt: i) copy. dd := list at: i. dd isNil ifFalse: [| pref | (pref := dd backgroundColor) notNil ifTrue: [lookPreference setBackgroundColor: pref]. (pref := dd foregroundColor) notNil ifTrue: [lookPreference setForegroundColor: pref]. (pref := dd pattern) notNil ifTrue: [lookPreference fillMask: (BG_ChartElement patternAt: pref)]. (pref := dd markerType) notNil ifTrue: [lookPreference marker: (BG_DataPointMarker imageAt: pref)]. (pref := dd lineType) notNil ifTrue: [lookPreference lineStyle: (BG_ChartElement perform: pref)]. (pref := dd lineWidth) notNil ifTrue: [lookPreference lineWidth: pref]. elementLooks at: i put: lookPreference]]
</methods> <methods> UI.BG_GriddedChartView <category>initialize-release</category>
initialize super initialize. grid := BG_ChartGrid new. grid x itemAxis. grid y scale decrease. dataStyle := BG_LabelList new. dataLocation := #hide. legend := BG_LabelList new. legend alignment: 4. legendFrame := BG_ChartElement new. legendLocation := 0. other := nil.
newGraphicsDevice: aGraphicsDevice super newGraphicsDevice: aGraphicsDevice. grid newGraphicsDevice: aGraphicsDevice. dataStyle newGraphicsDevice: aGraphicsDevice. legend newGraphicsDevice: aGraphicsDevice.
release "Remove the receiver as a dependent of the model's value" (model value notNil and: [model ~~ model value ]) ifTrue: [model value removeDependent: self]. self descriptors do: [:desc | desc release]. super release
</methods> <methods> UI.BG_GriddedChartView <category>accessing</category>
descriptors ^descriptors
descriptors: aColection "Set new descriptors if the model is already set set create new table adaptor." descriptors := aColection. model notNil ifTrue: [self getNewData]
gridType "Answer #normal as a defult. Some charts, like Pie Chart redefine this message" ^#normal
</methods> <methods> UI.BG_GriddedChartView <category>updating</category>
getNewData "Get new data and look from the model using descriptors." descriptors notNil ifTrue: [self dataFromDescriptions. self lookFromDescriptions]
update: anAspect with: aParameter from: anObject anObject == model value ifTrue: ["Update from collection of values - redraw the view. We should be more selective as far as wht to invalidate. See the method update:with:from: in SelctionView." anAspect == #at: ifTrue: ["In case the labels has changed" self grid x labelsStyle flushCaches] ifFalse: [self dataFromDescriptions]. self invalidate. ^self]. anAspect == #value ifTrue: [anObject == model ifTrue: [self dataFromDescriptions. self invalidate. ^self]]. super update: anAspect with: aParameter from: anObject
</methods> <methods> UI.BG_ChartScale <category>accessing</category>
autoMin: min max: max "Sets sources automatically from arguments" | amin amax factors | (min isNil or: [max isNil]) ifFalse: [amin := min min: max. amax := min max: max. factors := self getScaleMin: amin max: amax. self sourceMin: (factors at: 1) max: (factors at: 2). self step: (factors at: 3)]
decrease increase := false
destLength ^destMax - destMin
destLength: anInteger self destMin: destMin max: destMin + anInteger
destMax ^destMax
destMin ^destMin
destMin: min max: max destMin := min min: max. destMax := min max: max.
div ^div
div: positiveInteger div := positiveInteger
increase increase := true
reverse increase := increase not
sourceLength ^sourceMax - sourceMin
sourceLength: anInteger self sourceMin: sourceMin max: sourceMin + anInteger
sourceMax ^sourceMax
sourceMin ^sourceMin
sourceMin: min max: max sourceMin := min min: max. sourceMax := min max: max.
step ^step
step: positiveNumber positiveNumber isZero ifTrue: [step := 1] ifFalse: [step := positiveNumber abs]
zero ^zero isNil ifTrue: [sourceMin] ifFalse: [zero]
zero: aNumber zero := aNumber
</methods> <methods> UI.BG_ChartScale <category>private</category>
filter: aNumber "This allows the receiver to introduce non-linear mappings from data space to presentation space, such as eliminating gaps in the data." ^aNumber
getMainlyNegativeScaleMin: min max: max | minValue maxValue stepValue f i fr count | f := (min negated log: 10) roundTo: 0.00001. i := f asFloat integerPart asInteger. fr := f - i. #((0 -1 5) (0.32 -2 4) (0.49 -3 3) (0.7 -5 5) (0.908 -8 4) (1 -10 5)) do: [:a | (fr <= (a at: 1)) ifTrue: [minValue := (10 raisedTo: i) * (a at: 2). stepValue := (minValue / (a at: 3) roundTo: (10 raisedTo: i - 1)) negated. count := 0. [count * stepValue < max] whileTrue: [count := count + 1]. maxValue := stepValue * count. ^(Array with: minValue - (stepValue * 0.48) with: maxValue + (stepValue * 0.48) with: stepValue)]].
getMainlyPositiveScaleMin: min max: max | scale | scale := self getMainlyNegativeScaleMin: max negated max: min negated. ^Array with: (scale at: 2) negated with: (scale at: 1) negated with: (scale at: 3)
getOnlyNegativeScaleMin: min max: max | minValue maxValue stepValue f i fr | f := (min negated log: 10) roundTo: 0.00001. i := f asFloat integerPart asInteger. fr := f - i. #((0 -1 5) (0.32 -2 4) (0.49 -3 3) (0.7 -5 5) (0.908 -8 4) (1 -10 5)) do: [:a | (fr <= (a at: 1)) ifTrue: [minValue := (10 raisedTo: i) * (a at: 2). stepValue := (minValue / (a at: 3) roundTo: (10 raisedTo: i - 1)) negated. maxValue := 0. ^(Array with: minValue - (stepValue * 0.48) with: maxValue with: stepValue)]].
getOnlyPositiveScaleMin: min max: max | scale | scale := self getOnlyNegativeScaleMin: max negated max: min negated. ^Array with: (scale at: 2) negated with: (scale at: 1) negated with: (scale at: 3)
getScaleMin: min max: max (min = 0 and: [max = 0]) ifTrue: [^Array with: 0 with: 100 with: 20]. min >= 0 ifTrue: [^self getOnlyPositiveScaleMin: min max: max]. max <= 0 ifTrue: [^self getOnlyNegativeScaleMin: min max: max]. max abs >= min abs ifTrue: [^self getMainlyPositiveScaleMin: min max: max] ifFalse: [^self getMainlyNegativeScaleMin: min max: max]
inverseFilter: aNumber "This allows the receiver to introduce non-linear mappings from presentation space to data space, such as eliminating gaps in the data." ^aNumber
setMin: minValue max: maxValue by: stepValue from: zeroValue div: divisionValue "Initialize the instance variables." increase := true. zero := zeroValue. self sourceMin: minValue max: maxValue. self destMin: 0 max: self sourceLength. self step: stepValue. div := divisionValue
</methods> <methods> UI.BG_ChartScale <category>testing</category>
includesZero "Answer true if the receiver's zero is between minimum and maxmum value in source coodinates" ^self zero between: sourceMin and: sourceMax
incrementalScaled "Answer true if the receiver is an incremental scale" ^increase
scaleType "All subclasses like Log Scale will thier types" ^#normal
</methods> <methods> UI.BG_ChartScale <category>mark access</category>
divisionMarks "Answer collection of numbers that repesents positions of division mark in source coodinates" | offset marks mv | marks := OrderedCollection new. offset := (self zero - sourceMin) abs \\ step. self zero < sourceMin ifTrue: [offset := step - offset \\ step]. mv := self zero + (step / 2). sourceMin + offset + (step / 2) to: sourceMax by: step do: [:n | marks add: (mv coerce: n)]. ^marks
edgeMarks "Answer collection of numbers that repesents positions of minimum and maximum mark in source coodinates" ^OrderedCollection with: sourceMin with: sourceMax
majorMarks "Answer collection of numbers that repesents positions of major mark in source coodinates" | offset marks mv | marks := OrderedCollection new. offset := (self zero - sourceMin) abs \\ step. self zero < sourceMin ifTrue: [offset := step - offset \\ step]. mv := self zero + step. sourceMin + offset to: sourceMax by: step do: [:n | marks add: (mv coerce: n)]. ^marks
minorMarks "Answer collection of numbers that repesents positions of minor mark in source coodinates" | offset marks minorStep mv | minorStep := (step / div) asFloat. marks := OrderedCollection new. offset := (self zero - sourceMin) abs \\ minorStep. self zero < sourceMin ifTrue: [offset := minorStep - offset \\ minorStep]. mv := self zero + minorStep. sourceMin + offset to: sourceMax by: minorStep do: [:n | marks add: (mv coerce: n)]. ^marks
noMarks "Answer an empty collection." ^#()
zeroMarks "Answer collection of numbers that repesents positions of zero mark in source coodinates" | marks | marks := OrderedCollection new. self includesZero ifTrue: [marks add: self zero]. ^marks
</methods> <methods> UI.BG_ChartScale <category>applying transform</category>
applyInverseTo: aNumber "Answer translated value in source coodinates" | rate | rate := (aNumber - destMin) / self destLength. ^self inverseFilter: ((increase ifTrue: [rate] ifFalse: [1 - rate]) * self sourceLength + sourceMin)
applyInverseToValues: collectionOfNumbers "Answer translated values in source coodinates" ^collectionOfNumbers collect: [:each | self applyInverseTo: each]
applyTo: aNumber "Answer translated value in destination coodinates" | rate | self sourceLength = 0 ifTrue: [^destMin]. rate := ((self filter: aNumber) - sourceMin) asFloat / self sourceLength. ^(increase ifTrue: [rate] ifFalse: [1 - rate]) * self destLength + destMin
applyToValues: collectionOfNumbers "Answer translated values in destination coodinates" ^collectionOfNumbers collect: [:each | self applyTo: each]
</methods> <methods> UI.BG_ChartScale class <category>instance creation</category>
default "Answer a new instance of BG_ChartScale" ^self min: 0 max: 100 by: 20
min: minValue max: maxValue "Answer a new instance of BG_ChartScale" ^self min: minValue max: maxValue by: 1
min: minValue max: maxValue by: stepValue "Answer a new instance of BG_ChartScale" ^self min: minValue max: maxValue by: stepValue from: nil
min: minValue max: maxValue by: stepValue from: fromValue "Answer a new instance of BG_ChartScale" ^self min: minValue max: maxValue by: stepValue from: fromValue div: 1
min: minValue max: maxValue by: stepValue from: fromValue div: divValue "Answer a new instance of BG_ChartScale" ^super new setMin: minValue max: maxValue by: stepValue from: fromValue div: divValue
new "Provide an error notification that BG_ChartScales are not created using this message." self error: (#GenKey0 << #BGOK >> 'BG_ChartScales are created with range: , min:max: ...')
</methods> <methods> UI.BG_BarChartView <category>private</category>
defaultDataAlignment: v ^dataLocation = #outside ifTrue: [v >=0 ifTrue: [4] ifFalse: [6]] ifFalse: [5]
defaultDataOffset: v offset: offset ^dataLocation = #outside ifTrue: [v >=0 ifTrue: [offset@0] ifFalse: [offset negated@0]] ifFalse: [0@0]
displayBarOn: aGraphicsContext at: index vertex: p1 vertex: p2 | gc | gc := self setClientDataFor: aGraphicsContext index: index foreground: false. (BG_ChartElement on: (Rectangle vertex: p1 vertex: p2)) displayOn: gc
displayLabel: label angle: angle offset: o alignment: al on: gc at: p dataLocation = #inside ifTrue: [| gc2 | gc2 := gc copy. gc2 paint: self backgroundColor. gc2 displayRectangle: (grid box: label bounds by: angle origin: o alignment: al) at: p]. grid displayLabel: label angle: angle offset: o alignment: al on: gc at: p
legendSize ^self data rowSize" = 1 ifTrue: [self data columnSize] ifFalse: [self data rowSize]"
</methods> <methods> UI.BG_BarChartView <category>link</category>
hideLink "Do noting since bar charts have no link"
showLink "Do noting since bar charts have no link"
</methods> <methods> UI.BG_BarChartView <category>bar</category>
barOverlap ^barOverlap
barOverlap: relativeDegree barOverlap := relativeDegree min: 1.0
barWidth ^barWidth
barWidth: relativeWidth barWidth := (relativeWidth max: 0) min: 1
</methods> <methods> UI.BG_BarChartView <category>displaying</category>
displayDataOn: aGraphicsContext | value images angle sw ow gc base | value := self data. base := grid y scale zero. gc := aGraphicsContext copy. images := dataStyle individualImages. angle := self defaultDataAngle. ow := barWidth / (value rowSize - ((value rowSize -1) * barOverlap)) * 0.5. sw := ow * 2 * (1 - barOverlap). 1 to: value columnSize do: [:x | | n | n := sortedIndex at: x. 1 to: value rowSize do: [:y | | v py | v := value at: n@y. py := dataLocation = #outside ifTrue: [v ] ifFalse: [base + (v - base // 2) ]. self displayLabel: (images at: n@y) angle: angle offset: (self defaultDataOffset: v offset: 4) alignment: (self defaultDataAlignment: v) on: gc at: (grid applyTo: x - ((barWidth / 2)) + ((y-1) * sw) +ow@(py)) rounded]]
displayPlotOn: aGraphicsContext | value points collection sw base | value := self data. base := grid y scale zero. sw := barWidth / (value rowSize - ((value rowSize -1) * barOverlap)) * (1 - barOverlap). points := BG_TableAdaptor columns: value columnSize * 2 rows: value rowSize. 1 to: value columnSize do: [:x | | n | n := sortedIndex at: x. 1 to: value rowSize do: [:y | points at: x * 2 -1@y put: x - (barWidth / 2) + ((y-1) * sw )@(value at: n@y). points at: x * 2@y put: x + (barWidth / 2) - ((value rowSize - y) * sw)@base]]. collection := grid applyToValues: points. 1 to: value columnSize do: [:x | value rowSize to: 1 by: -1 do: [:y | self displayBarOn: aGraphicsContext at: y vertex: (collection at: x * 2-1@y) rounded vertex: (collection at: x * 2@y) rounded]]
</methods> <methods> UI.BG_BarChartView <category>initialize-release</category>
initialize super initialize. barWidth := 0.8. barOverlap := 0.
</methods> <methods> UI.BG_BarChartView <category>picture/unit</category>
picture: anObject "Do nothing since I have no picture. This method is overridden in BG_PcitureChartView"
unit: aNumber "Do nothing since I have no picture. This method is overridden in BG_PcitureChartView"
</methods> <methods> UI.BG_BarChartView class <category>private-images</category>
defaultPicture ^Image extent: 16 @ 16 depth: 1 palette: MonoMappedPalette whiteBlack bits: #[63 252 127 254 7 224 31 248 63 252 125 190 240 15 245 175 245 191 240 15 253 175 245 167 240 15 253 191 255 255 255 255 ] pad: 16
</methods> <methods> UI.BG_StackedBarChartView <category>link</category>
hideLink showLink := false
isLinkVisible ^showLink
showLink showLink := true
</methods> <methods> UI.BG_StackedBarChartView <category>private-default-model</category>
defaultNbrOfSeries ^2
defaultPointFor: aValue column: aColumn range: aRange | val | val := (aColumn = 1 ifTrue: [aValue] ifFalse: [aValue > 0 ifTrue: [aRange last - aValue / aColumn] ifFalse: [aRange first - aValue / aColumn]]). ^val abs > 2 ifTrue: [val asInteger] ifFalse: [val asFloat]
defaultRangeFromScale: aScale andNumberOfSeries: aNumber ^Array with: aScale sourceMin - aScale zero with: aScale sourceMax - aScale zero
</methods> <methods> UI.BG_StackedBarChartView <category>private</category>
dataRangeMatrix | matrix value | value := self data. matrix := Array new: value columnSize. 1 to: value columnSize do: [:x | matrix at: x put: (self sum: (value columnAt: x))]. ^matrix
rates | rdata values | values := self data. rdata := BG_TableAdaptor columns: values columnSize rows: values rowSize. 1 to: values columnSize do: [:x | rdata columnAt: x put: (self roundedRates: (self rates: (values columnAt: x)))]. ^rdata
</methods> <methods> UI.BG_StackedBarChartView <category>initialize-release</category>
initialize super initialize. showLink := false.
</methods> <methods> UI.BG_StackedBarChartView <category>displaying</category>
displayDataOn: aGraphicsContext | value images angle savedData isP gc | dataLocation = #outside ifTrue: [savedData := self data. self data: self sortedValues. super displayDataOn: aGraphicsContext. self data: savedData] ifFalse: [value := self data. (isP := self isPercentage) ifTrue: [savedData := self data. self data: self rates]. gc := aGraphicsContext copy. images := dataStyle individualImages. angle := self defaultDataAngle. 1 to: value columnSize do: [:x | | v1 v2 | v1 := v2 := grid y scale zero. 1 to: value rowSize do: [:y | | n | n := sortedIndex at: x. v2 := v1 + (value at: n@y). self displayLabel: (images at: n@y) angle: angle offset: 0@0 alignment: 5 on: gc at: (grid applyTo: x@((v2 - v1 / 2 ) + v1)) rounded. v1 := v2]]. isP ifTrue: [self data: savedData]]
displayPlotOn: aGraphicsContext | value points collection | value := self data. points := BG_TableAdaptor columns: value columnSize * 2 rows: value rowSize. 1 to: value columnSize do: [:x | | n v | n := sortedIndex at: x. v := grid y scale zero. 1 to: value rowSize do: [:y | points at: x * 2@y put: x + (barWidth / 2)@v. points at: x * 2 - 1@y put: x - (barWidth / 2)@ (v := v + (value at: n@y))]]. collection := grid applyToValues: points. 1 to: value columnSize do: [:x | 1 to: value rowSize do: [:y | self displayBarOn: aGraphicsContext at: y vertex: (collection at: x * 2-1@y) rounded vertex: (collection at: x * 2@y) rounded]]. showLink & (barWidth < 1) ifTrue: [1 to: value columnSize -1 do: [:x | 1 to: value rowSize do: [:y | (LineSegment from: (grid applyTo: (points at: (x * 2@y)) x@((points at: x *2 -1@y) y)) to: (collection at: (x + 1 * 2 -1@y))) asStroker displayOn: aGraphicsContext]]]
</methods> <methods> UI.BG_BandChartView <category>private</category>
compose super compose. self composeData
composeData | rdata values | values := self data. rdata := BG_TableAdaptor columns: values columnSize rows: values rowSize. 1 to: values columnSize do: [:x | rdata columnAt: x put: (self rates: (values columnAt: x))]. rates := rdata.
</methods> <methods> UI.BG_BandChartView <category>displaying</category>
displayDataOn: aGraphicsContext | value images angle savedData isP gc | dataLocation = #outside ifTrue: [savedData := self data. self data: self sortedValues. value := self data collect: [:v| 100]. gc := aGraphicsContext copy. images := dataStyle individualImages. angle := self defaultDataAngle. 1 to: value columnSize do: [:i | | n | n := sortedIndex at: i. 1 to: value rowSize do: [:y | | v | v := value at: n @ y. self displayLabel: (images at: n @ y) angle: angle offset: (self defaultDataOffset: v offset: 4) alignment: (self defaultDataAlignment: v) on: gc at: (grid applyTo: i @ v) rounded]]. self data: savedData] ifFalse: [value := rates collect: [:r | r * 100]. (isP := self isPercentage) ifTrue: [savedData := self data. self data: self rates]. gc := aGraphicsContext copy. images := dataStyle individualImages. angle := self defaultDataAngle. 1 to: value columnSize do: [:x | | v1 v2 | v1 := v2 := 0. 1 to: value rowSize do: [:y | | n | n := sortedIndex at: x. v2 := v1 + (value at: n @ y). self displayLabel: (images at: n @ y) angle: angle offset: 0 @ 0 alignment: 5 on: gc at: (grid applyTo: x @ (v2 - v1 / 2 + v1)) rounded. v1 := v2]]. isP ifTrue: [self data: savedData]]
displayPlotOn: aGraphicsContext | savedItem savedZero | savedZero := grid y scale zero. grid y scale zero: 0. savedItem := self data. self data: (rates collect: [:r | r * 100]). super displayPlotOn: aGraphicsContext. grid y scale zero: savedZero. self data: savedItem
</methods> <methods> UI.BG_BandChartView <category>initialize-release</category>
initialize super initialize. grid y manualScale. showLink := false
</methods> <methods> UI.BG_ChartElement <category>accessing</category>
drawLine: aBoolean stroke := aBoolean
fillInside: aBoolean fill := aBoolean and: [component canBeFilled]
lineWidth "Answer the width of the line used for rendering this object" ^lineWidth
lineWidth: aNumber "Set the width of the line used for rendering this object" lineWidth := aNumber
shadowOffset: aPoint shadowOffset := aPoint asPoint
</methods> <methods> UI.BG_ChartElement <category>displaying</category>
displayOn: aGraphicsContext "Display my component by filling and then stroking it." | style gc | lineWidth == nil ifFalse: [aGraphicsContext lineWidth: lineWidth]. style := aGraphicsContext clientDataAt: #chartElement ifAbsent: []. gc := aGraphicsContext copy. style == nil ifTrue: [style := self lookPreferences. style setForegroundColor: aGraphicsContext paint]. shadowOffset = (0 @ 0) ifFalse: [gc translateBy: shadowOffset. gc paint: (style selectionBackgroundColor ifNil: [SymbolicPaint selectionBackground]). fill ifTrue: [component displayFilledOn: gc]. stroke ifTrue: [component displayStrokedOn: gc]]. fill ifTrue: [gc paint: (style backgroundColor ifNil: [SymbolicPaint background]). self fillOn: gc style: style]. (stroke and: [style lineStyle ~= #none]) ifTrue: [gc paint: (style foregroundColor ifNil: [SymbolicPaint foreground]). self strokeOn: gc style: style]
fillOn: aGraphicsContext style: style "Display my component by filling it." ((style respondsTo: #fillMask) not or: [style fillMask == nil]) ifTrue: [component displayFilledOn: aGraphicsContext] ifFalse: [| mask gc rect | rect := self bounds rounded. (rect width > 0 and: [rect height > 0]) ifTrue: [mask := Mask extent: rect extent. gc := mask graphicsContext. gc translateBy: rect origin negated. gc paint: style fillMask asPattern. component displayFilledOn: gc. mask displayOn: aGraphicsContext at: rect origin. mask close]]
lookPreferences ^BG_ChartElementLook from: super lookPreferences
strokeDottedOn: aGraphicsContext style: style "Display my component by stroking it." | p1 p2 p3 theta lineStyle path | lineStyle := style lineStyle. path := component asPolyline vertices. self displayDottedPolyline: path on: aGraphicsContext using: lineStyle. ((component isKindOf: EllipticalArc) and: [component sweepAngle abs < 360]) ifFalse: [^self]. p2 := component center. theta := component startAngle degreesToRadians. p1 := theta cos@theta sin * component radiusAsPoint + p2. theta := (component startAngle + component sweepAngle) degreesToRadians. p3 := theta cos@theta sin * component radiusAsPoint + p2. self displayDottedPolyline: (Array with: p1 with: p2 with: p3) on: aGraphicsContext using: lineStyle.
strokeOn: aGraphicsContext style: style "Display my component by stroking it." | p1 p2 p3 theta | style lineStyle == nil ifFalse: [^self strokeDottedOn: aGraphicsContext style: style]. component displayStrokedOn: aGraphicsContext. ((component isKindOf: EllipticalArc) and: [component sweepAngle abs < 360]) ifFalse: [^self]. p2 := component center. theta := component startAngle degreesToRadians. p1 := theta cos@theta sin * component radiusAsPoint + p2. theta := (component startAngle + component sweepAngle) degreesToRadians. p3 := theta cos@theta sin * component radiusAsPoint + p2. (Polyline vertices: (Array with: p1 with: p2 with: p3)) displayStrokedOn: aGraphicsContext
</methods> <methods> UI.BG_ChartElement <category>testing</category>
intersects: aRectangle "Answer whether the receiver's display area intersects aRectangle." (fill and: [component regionIntersects: aRectangle]) ifTrue: [^true]. ^lineWidth == nil ifTrue: [component outlineIntersects: aRectangle] ifFalse: [component outlineIntersects: (aRectangle expandedBy: lineWidth+1//2)]
isPathVisible ^stroke
</methods> <methods> UI.BG_ChartElement <category>bounds accessing</category>
bounds "Answer the component's bounds." ^self preferredBounds
</methods> <methods> UI.BG_ChartElement <category>initialization</category>
initialize "Set aGeometric to be the receiver's component." super initialize. stroke := true. fill := false. shadowOffset := 0@0
setComponent: aGeometric "Set aGeometric to be the receiver's component." super setComponent: aGeometric. fill := aGeometric canBeFilled
</methods> <methods> UI.BG_ChartElement <category>component protocol suppression</category>
preferredBounds "Answer the component's preferredBounds." ^(component isKindOf: EllipticalArc) ifTrue: [super preferredBounds merge: (component center extent: 0@0)] ifFalse: [super preferredBounds]
</methods> <methods> UI.BG_ChartElement <category>private</category>
displayDottedPolyline: pointArray on: aGraphicsContext using: lineStyle | len count styleSize penDown capDelta | len := 0. count := 0. styleSize := lineStyle size. capDelta := aGraphicsContext capStyle = GraphicsContext capButt ifTrue: [0] ifFalse: [aGraphicsContext lineWidth]. penDown := false. 1 to: pointArray size -1 do: [:i | | lineLength lineAngle originX originY stepX stepY p1 p2 dash startPoint endPoint | startPoint := pointArray at: i. endPoint := pointArray at: i + 1. (lineLength := startPoint dist: endPoint) = 0.0 ifFalse: [originX := startPoint x. originY := startPoint y. lineAngle := (endPoint - startPoint) theta. stepX := lineAngle cos. stepY := lineAngle sin. len <= lineLength ifTrue: [len = 0 ifTrue: [p1 := startPoint] ifFalse: [p1:= Point x: (originX + (stepX * len)) rounded y: (originY + (stepY * len)) rounded. penDown ifTrue: [aGraphicsContext displayLineFrom: startPoint to: p1]]. [| index | index := (count := count + 1) - 1 \\ styleSize + 1. penDown := index odd. len := len + (dash := (lineStyle at: index) + (penDown ifTrue: [0] ifFalse: [capDelta])). len <= lineLength] whileTrue: [penDown ifTrue: [p2 := Point x: (p1 x + (stepX * dash)) rounded y: (p1 y + (stepY * dash)) rounded. aGraphicsContext displayLineFrom: p1 to: p2] ifFalse: [p2 := Point x: (originX + (stepX * len)) rounded y: (originY + (stepY * len)) rounded]. p1 := p2]] ifFalse: [p1 := startPoint]. penDown ifTrue: [aGraphicsContext displayLineFrom: p1 to: endPoint]. len := (len - lineLength) rounded]]
</methods> <methods> UI.BG_ChartElement class <category>line style constants</category>
broken ^#[6 4 4 4 6]
broken2 ^#[10 4 4 4 4 4 10]
dashed ^#[4 2 4]
dashed2 ^#[8 4 8]
dotted ^#[2 4 2]
dotted2 ^#[4 8 4]
none ^#none
solid ^nil
</methods> <methods> UI.BG_ChartElement class <category>class initialization</category>
initialize "BG_ChartElement initialize" self initializePatterns. self initializeShades
initializePatterns "BG_ChartElement initializePatterns" Patterns := OrderedCollection new. Patterns add: #[255 255 255 255 255 255 255 255]. Patterns add: #[0 0 0 0 0 0 0 0]. Patterns add: #[85 85 85 85 85 85 85 85]. Patterns add: #[51 51 51 51 51 51 51 51]. Patterns add: #[255 68 68 68 255 68 68 68]. Patterns add: #[8 8 8 8 255 8 8 8]. Patterns add: #[17 136 68 34 17 136 68 34]. Patterns add: #[68 136 17 34 68 136 17 34]. Patterns add: #[16 32 64 128 1 2 4 8]. Patterns add: #[193 224 112 56 28 14 7 131]. Patterns add: #[224 193 131 7 14 28 56 112]. Patterns add: #[12 18 33 192 192 33 18 12]. Patterns add: #[130 68 40 16 40 68 130 1]. Patterns add: #[0 255 0 255 0 255 0 255]. Patterns add: #[221 221 221 221 221 221 221 221 ]. Patterns add: #[255 255 0 255 255 255 0 255 ]. Patterns add: #[63 63 63 63 63 63 63 63 ]. Patterns add: #[255 255 0 255 255 255 255 255]. Patterns add: #[0 0 255 255 0 0 255 255]. Patterns add: #[187 187 0 187 187 187 0 187]. Patterns add: #[247 247 0 247 247 247 247 247]. Patterns add: #[187 221 238 119 187 221 238 119 ]. Patterns add: #[238 221 187 119 238 221 187 119 ]. Patterns add: #[239 247 251 253 254 127 191 223]. Patterns add: #[191 127 254 253 251 247 239 223]. Patterns add: #[204 102 51 153 204 102 51 153]. Patterns add: #[51 102 204 153 51 102 204 153]. Patterns add: #[222 63 63 222 237 243 243 237]. Patterns add: #[215 239 215 187 125 254 125 187]. Patterns add: #[2 2 32 32 2 2 32 32 ]. Patterns add: #[68 136 17 0 68 136 17 0]. Patterns add: #[120 120 120 120 135 135 135 135]. Patterns add: #[127 62 28 8 0 8 28 62 ]. Patterns add: #[27 24 129 177 54 6 96 99]. Patterns add: #[2 4 8 16 32 80 136 5 ]. Patterns add: #[255 4 4 4 255 64 64 64]. Patterns add: #[32 64 128 0 8 4 2 0]. Patterns add: #[15 30 36 66 225 240 72 132]. Patterns add: #[227 197 136 92 62 29 136 209]. Patterns add: #[68 68 40 16 1 130 68 68 ]. Patterns add: #[17 34 68 136 136 68 34 17]. Patterns add: #[17 0 16 0 85 0 16 0 ]. Patterns add: #[32 32 80 143 2 2 5 248 ]. Patterns add: #[187 76 124 124 187 196 199 199]. Patterns add: #[64 160 0 0 4 10 0 0]. Patterns add: #[0 0 153 0 0 0 102 0]. Patterns add: #[0 34 17 136 0 34 17 136]. Patterns add: #[51 204 204 51 51 204 204 51]. Patterns add: #[20 8 0 8 20 42 85 42 ]. Patterns add: #[8 128 16 2 64 4 32 1]. Patterns add: #[8 4 2 3 132 72 48 16 ]. Patterns add: #[251 251 0 191 191 191 0 251 ]. Patterns add: #[16 16 40 68 147 68 40 16]. Patterns add: #[8 16 32 64 168 85 255 4 ]. Patterns add: #[65 127 239 40 239 111 111 127 ]. Patterns add: #[32 32 170 5 2 2 170 80 ]. Patterns add: #[36 24 129 66 36 24 129 66 ]. Patterns add: #[32 32 96 144 9 6 129 64 ]. Patterns add: #[52 44 190 125 190 125 52 44 ]. Patterns add: #[85 0 68 10 17 160 68 0 ]. Patterns add: #[11 11 251 0 251 251 11 11]. Patterns add: #[128 8 0 0 32 2 0 0 ]. Patterns add: #[69 8 164 64 42 132 72 128 ]. Patterns add: #[170 68 170 17 170 68 170 17 ]. Patterns add: #[17 164 74 136 37 72 163 68 ]. Patterns add: #[0 9 64 4 1 16 128 36 ]. Patterns add: #[0 85 1 85 1 85 1 127 ]. Patterns add: #[63 33 33 63 243 18 18 243 ]. Patterns add: #[4 168 4 34 1 168 1 34 ]. Patterns add: #[16 8 4 2 21 170 255 32 ]. Patterns add: #[239 238 254 130 254 238 239 40 ]. Patterns add: #[4 164 85 170 4 4 4 4 ]. Patterns add: #[239 123 255 222 247 127 223 253 ]. Patterns add: #[223 186 223 238 247 186 247 238 ]. Patterns add: #[175 250 246 175 123 238 191 234]. Patterns add: #[125 238 255 170 255 238 215 187 ].
initializePatterns_Orig "BG_ChartElement initializePatterns" Patterns := OrderedCollection new. Patterns add: #[255 255 255 255 255 255 255 255]. Patterns add: #[0 0 0 0 0 0 0 0]. Patterns add: #[85 85 85 85 85 85 85 85]. Patterns add: #[34 34 34 34 34 34 34 34]. Patterns add: #[255 0 0 0 255 0 0 0]. Patterns add: #[128 128 128 128 128 128 128 128]. Patterns add: #[0 0 0 0 255 0 0 0]. Patterns add: #[51 51 51 51 51 51 51 51]. Patterns add: #[255 68 68 68 255 68 68 68]. Patterns add: #[8 8 8 8 255 8 8 8]. Patterns add: #[17 136 68 34 17 136 68 34]. Patterns add: #[68 136 17 34 68 136 17 34]. Patterns add: #[64 32 16 8 4 2 1 128]. Patterns add: #[16 32 64 128 1 2 4 8]. Patterns add: #[193 224 112 56 28 14 7 131]. Patterns add: #[224 193 131 7 14 28 56 112]. Patterns add: #[12 18 33 192 192 33 18 12]. Patterns add: #[130 68 40 16 40 68 130 1]. Patterns add: #[0 255 0 255 0 255 0 255]. Patterns add: #[221 221 221 221 221 221 221 221 ]. Patterns add: #[255 255 0 255 255 255 0 255 ]. Patterns add: #[127 127 127 127 127 127 127 127]. Patterns add: #[255 255 0 255 255 255 255 255]. Patterns add: #[0 0 255 255 0 0 255 255]. Patterns add: #[187 187 0 187 187 187 0 187]. Patterns add: #[247 247 0 247 247 247 247 247]. Patterns add: #[187 221 238 119 187 221 238 119 ]. Patterns add: #[238 221 187 119 238 221 187 119 ]. Patterns add: #[239 247 251 253 254 127 191 223]. Patterns add: #[191 127 254 253 251 247 239 223]. Patterns add: #[204 102 51 153 204 102 51 153]. Patterns add: #[51 102 204 153 51 102 204 153]. Patterns add: #[222 63 63 222 237 243 243 237]. Patterns add: #[215 239 215 187 125 254 125 187]. Patterns add: #[2 2 32 32 2 2 32 32 ]. Patterns add: #[68 136 17 0 68 136 17 0]. Patterns add: #[120 120 120 120 135 135 135 135]. Patterns add: #[127 62 28 8 0 8 28 62 ]. Patterns add: #[27 24 129 177 54 6 96 99]. Patterns add: #[2 4 8 16 32 80 136 5 ]. Patterns add: #[255 4 4 4 255 64 64 64]. Patterns add: #[32 64 128 0 8 4 2 0]. Patterns add: #[15 30 36 66 225 240 72 132]. Patterns add: #[227 197 136 92 62 29 136 209]. Patterns add: #[68 68 40 16 1 130 68 68 ]. Patterns add: #[17 34 68 136 136 68 34 17]. Patterns add: #[17 0 16 0 85 0 16 0 ]. Patterns add: #[32 32 80 143 2 2 5 248 ]. Patterns add: #[187 76 124 124 187 196 199 199]. Patterns add: #[64 160 0 0 4 10 0 0]. Patterns add: #[0 0 153 0 0 0 102 0]. Patterns add: #[0 34 17 136 0 34 17 136]. Patterns add: #[51 204 204 51 51 204 204 51]. Patterns add: #[20 8 0 8 20 42 85 42 ]. Patterns add: #[8 128 16 2 64 4 32 1]. Patterns add: #[8 4 2 3 132 72 48 16 ]. Patterns add: #[251 251 0 191 191 191 0 251 ]. Patterns add: #[16 16 40 68 147 68 40 16]. Patterns add: #[8 16 32 64 168 85 255 4 ]. Patterns add: #[65 127 239 40 239 111 111 127 ]. Patterns add: #[32 32 170 5 2 2 170 80 ]. Patterns add: #[36 24 129 66 36 24 129 66 ]. Patterns add: #[32 32 96 144 9 6 129 64 ]. Patterns add: #[52 44 190 125 190 125 52 44 ]. Patterns add: #[85 0 68 10 17 160 68 0 ]. Patterns add: #[11 11 251 0 251 251 11 11]. Patterns add: #[128 8 0 0 32 2 0 0 ]. Patterns add: #[69 8 164 64 42 132 72 128 ]. Patterns add: #[170 68 170 17 170 68 170 17 ]. Patterns add: #[17 164 74 136 37 72 163 68 ]. Patterns add: #[0 9 64 4 1 16 128 36 ]. Patterns add: #[0 85 1 85 1 85 1 127 ]. Patterns add: #[63 33 33 63 243 18 18 243 ]. Patterns add: #[4 168 4 34 1 168 1 34 ]. Patterns add: #[16 8 4 2 21 170 255 32 ]. Patterns add: #[239 238 254 130 254 238 239 40 ]. Patterns add: #[4 164 85 170 4 4 4 4 ]. Patterns add: #[239 123 255 222 247 127 223 253 ]. Patterns add: #[223 186 223 238 247 186 247 238 ]. Patterns add: #[175 250 246 175 123 238 191 234]. Patterns add: #[125 238 255 170 255 238 215 187 ].
initializeShades "BG_ChartElement initializeShades" ShadeMaker := OrderedDither order: 6
</methods> <methods> UI.BG_ChartElement class <category>shades and patterns</category>
patternAt: anInteger "BG_ChartElement patternAt: 33" ^self patternAt: anInteger palette: CoveragePalette monoMaskPalette
patternAt: anInteger palette: aDepth1Palette "BG_ChartElement patternAt: 20 palette: (MappedPalette with: ColorValue red with: ColorValue blue)" ^Image extent: 8 @ 8 depth: 1 palette: aDepth1Palette bits: (Patterns at: anInteger - 1 \\ Patterns size + 1) pad: 8
patternsSize ^Patterns size
shadeAt: anInteger "BG_ChartElement shadeAt: 33" | size index gc | size := self shadesSize. index := anInteger - 1 \\ size + 1. gc := (Image extent: ShadeMaker extent depth: CoveragePalette monoMaskPalette depth palette: CoveragePalette monoMaskPalette) asRetainedMedium graphicsContext. gc paintPolicy: ((PaintPolicy new) imageRenderer: ShadeMaker; paintRenderer: ShadeMaker). gc paint: (CoverageValue coverage: index - 1 / (size - 1)). gc displayRectangle: (0 @ 0 extent: ShadeMaker extent). ^gc medium asImage
shadesSize ^ShadeMaker uniformRangeLevels
</methods> <methods> UI.BG_ChartDataSetDescription <category>accessing</category>
adaptor ^adaptor
adaptor: aValue adaptor := aValue
backgroundColor ^backgroundColor
backgroundColor: aValue backgroundColor := aValue
foregroundColor ^foregroundColor
foregroundColor: aValue foregroundColor := aValue
hasData ^hasData
hasData: aValue hasData := aValue
hasLabel ^hasData not
holdData hasData := true.
holdLabel hasData := false.
lineType ^lineType
lineType: aValue lineType := aValue
lineWidth ^lineWidth
lineWidth: aValue lineWidth := aValue
markerType ^markerType
markerType: aValue markerType := aValue
name ^name
name: aString name := aString
pattern ^pattern
pattern: aValue pattern := aValue
</methods> <methods> UI.BG_ChartDataSetDescription <category>initalize-release</category>
initialize name := ''. self holdData
release self adaptor isNil ifFalse: [self adaptor releaseParts]. super release
</methods> <methods> UI.BG_ChartDataSetDescription class <category>instance-creation</category>
new ^super new initialize
</methods> <methods> UI.BG_ChartGrid <category>displaying</category>
displayHAxisOn: aGraphicsContext | h hs vs py line marks | hs := (h := self h) scale. vs := self v scale. py := (vs includesZero ifTrue: [vs applyTo: vs zero] ifFalse: [vs incrementalScaled ifTrue: [vs destMin] ifFalse: [vs destMax]]) rounded. "Display axis line" (line := h axisLine) isPathVisible ifTrue: [aGraphicsContext displayLineFrom: hs destMin @ py to: hs destMax @ py]. "Display major tick marks" (line := h majorTick) isPathVisible ifTrue: [marks := hs applyToValues: hs majorMarks. line := line component. vs incrementalScaled ifFalse: [line := LineSegment from: line start negated to: line end negated]. line := line asStroker. 1 to: marks size do: [:i | line displayOn: aGraphicsContext at: (marks at: i) rounded @ py]]. "Display minor tick marks" ((line := h minorTick) isPathVisible and: [hs div ~= 1]) ifTrue: [marks := hs applyToValues: hs minorMarks. line := line component. vs incrementalScaled ifFalse: [line := LineSegment from: line start negated to: line end negated]. line := line asStroker. 1 to: marks size do: [:i | line displayOn: aGraphicsContext at: (marks at: i) rounded @ py]]
displayHLabelsOn: aGraphicsContext | gc h hs vs marks py images sizeOfLabels | hs := (h := self h) scale. vs := self v scale. py := ((vs includesZero and: [h isAutoLabeled]) ifTrue: [vs applyTo: vs zero] ifFalse: [vs incrementalScaled ifTrue: [vs destMin] ifFalse: [vs destMax]]) rounded. "Display axis labels" marks := hs applyToValues: h labelsMarks. gc := aGraphicsContext copy. images := h labelsStyle individualImages. sizeOfLabels := marks size min: images size. 1 to: sizeOfLabels do: [:i | | image | image := images at: i. image displayOn: gc at: (marks at: i) rounded - (image bounds extent x // 2) @ (vs incrementalScaled ifTrue: [py - 5 - image bounds extent y] ifFalse: [py + 5])]. "Display axis unit" (h unit notNil and: [sizeOfLabels > 0]) ifTrue: [h unitStyle displayOn: aGraphicsContext at: (marks at: sizeOfLabels) rounded + (hs incrementalScaled ifTrue: [(images at: sizeOfLabels) bounds extent x // 2 + 5] ifFalse: [0-((images at: sizeOfLabels) bounds extent x // 2 + 5 + h unitStyle extent x)])@ (vs incrementalScaled ifTrue: [py - 5 - h unitStyle extent y] ifFalse: [py + 5])]. "Display axis title" h title notNil ifTrue: [| lh | h titleStyle rotation ~= 0 ifTrue: [h titleStyle rotation: 0]. h titleStyle scale ~= (1 @ 1) ifTrue: [h titleStyle scale: 1 @ 1]. lh := h labelsStyle individualExtent y. h titleStyle displayOn: aGraphicsContext at: self insetBounds center x - (h titleStyle extent x // 2) @ (vs incrementalScaled ifTrue: [py - (lh + 5 + h titleStyle extent y)] ifFalse: [py + (lh + 5)])]
displayHLinesOn: aGraphicsContext | v hs vs block marks line startX endX | vs := (v := self v) scale. hs := self h scale. startX := hs destMin rounded. endX := hs destMax rounded. line := v sectionLine. block := [:py :gc | gc displayLineFrom: startX @ py to: endX @ py]. "Display section lines" line isPathVisible ifTrue: [marks := vs applyToValues: v sectionMarks. 1 to: marks size do: [:i | block value: (marks at: i) rounded value: aGraphicsContext]]. "Display border lines" (line := v borderLine) isPathVisible ifTrue: [marks := vs applyToValues: vs edgeMarks. block value: marks first rounded value: aGraphicsContext. block value: marks last rounded value: aGraphicsContext]
displayOn: aGraphicsContext self displayHLinesOn: aGraphicsContext. self displayVLinesOn: aGraphicsContext. self displayHAxisOn: aGraphicsContext. self displayVAxisOn: aGraphicsContext. self displayHLabelsOn: aGraphicsContext. self displayVLabelsOn: aGraphicsContext
displayVAxisOn: aGraphicsContext | v vs hs px line marks fixup | vs := (v := self v) scale. hs := self h scale. px := (hs includesZero ifTrue: [hs applyTo: hs zero] ifFalse: [hs incrementalScaled ifTrue: [hs destMin] ifFalse: [hs destMax]]) rounded. "Display axis line" (line := v axisLine) isPathVisible ifTrue: [aGraphicsContext displayLineFrom: px @ vs destMin to: px @ vs destMax]. "Display major tick marks" (line := v majorTick) isPathVisible ifTrue: [marks := vs applyToValues: vs majorMarks. fixup := hs incrementalScaled ifTrue: [1] ifFalse: [-1]. line := line component. line := (LineSegment from: line start transpose * fixup to: line end transpose * fixup) asStroker. 1 to: marks size do: [:i | line displayOn: aGraphicsContext at: px @ (marks at: i) rounded]]. "Display minor tick marks" ((line := v minorTick) isPathVisible and: [vs div ~= 1]) ifTrue: [marks := vs applyToValues: vs minorMarks. fixup := hs incrementalScaled ifTrue: [1] ifFalse: [-1]. line := line component. line := (LineSegment from: line start transpose * fixup to: line end transpose * fixup) asStroker. 1 to: marks size do: [:i | line displayOn: aGraphicsContext at: px @ (marks at: i) rounded]]
displayVLabelsOn: aGraphicsContext | gc v hs vs marks px images sizeOfLabels | vs := (v := self v) scale. hs := self h scale. "Display axis labels" marks := vs applyToValues: v labelsMarks. px := ((hs includesZero and: [v isAutoLabeled]) ifTrue: [hs applyTo: hs zero] ifFalse: [hs incrementalScaled ifTrue: [hs destMin] ifFalse: [hs destMax]]) rounded. gc := aGraphicsContext copy. images := v labelsStyle individualImages. sizeOfLabels := marks size min: images size. 1 to: sizeOfLabels do: [:i | | image | image := images at: i. image displayOn: gc at: (hs incrementalScaled ifTrue: [px - 5 - image width] ifFalse: [px + 5]) @ ((marks at: i) rounded - (image height // 2))]. (v unit notNil and: [sizeOfLabels > 0]) ifTrue: ["Display axis unit" v unitStyle displayOn: aGraphicsContext at: (hs incrementalScaled ifTrue: [px - 5 - v unitStyle extent x] ifFalse: [px + 5]) @ ((marks at: sizeOfLabels) rounded + (vs incrementalScaled ifTrue: [(images at: sizeOfLabels) bounds extent y // 2 + 5] ifFalse: [0 - ((images at: sizeOfLabels) bounds extent y // 2 + 5 + v unitStyle extent y)]))]. v title notNil ifTrue: ["Display axis title" | lw | v titleStyle rotation ~= 3 ifTrue: [v titleStyle rotation: 3]. v titleStyle scale ~= (1 @ 1) ifTrue: [v titleStyle scale: 1 @ 1]. lw := v labelsStyle individualExtent x. v titleStyle displayOn: aGraphicsContext at: (hs incrementalScaled ifTrue: [px - (lw + 5 + v titleStyle extent x)] ifFalse: [px + (lw + 5)]) @ (self insetBounds center y - (v titleStyle extent y // 2))]
displayVLinesOn: aGraphicsContext | h hs vs block marks line startY endY | vs := self v scale. hs := (h := self h) scale. startY := vs destMin rounded. endY := vs destMax rounded. line := h sectionLine. block := [:px :gc | gc displayLineFrom: px @ startY to: px @ endY]. "Display section lines" line isPathVisible ifTrue: [marks := hs applyToValues: h sectionMarks. 1 to: marks size do: [:i | block value: (marks at: i) rounded value: aGraphicsContext]]. "Display border lines" (line := h borderLine) isPathVisible ifTrue: [marks := hs applyToValues: hs edgeMarks. block value: marks first rounded value: aGraphicsContext. block value: marks last rounded value: aGraphicsContext]
</methods> <methods> UI.BG_ChartGrid <category>visual properties</category>
lookPreferences ^x getLookPreferences
</methods> <methods> UI.BG_ChartGrid <category>accessing</category>
h "Answer receiver's horizontal axis" ^transposed ifTrue: [y] ifFalse: [x]
transpose "Transpose the recever's scales" transposed := transposed not. self bounds: self bounds
v "Answer receiver's vertical axis" ^transposed ifTrue: [x] ifFalse: [y]
x ^x
x: anAxis "Make the argument, anAxis, the receiver's x axis" x := anAxis
y ^y
y: anAxis "Make the argument, anAxis, the receiver's y axis" y := anAxis
</methods> <methods> UI.BG_ChartGrid <category>bounds accessing</category>
bounds: aRectangle | boundingBox op cp offsetx offsety| x compose. y compose. boundingBox := Rectangle origin: Point zero extent: (aRectangle extent max: self minimumExtent). boundingBox := boundingBox align: boundingBox center with: aRectangle center. op := 0@0. cp := 0@0. offsetx := self h labelsStyle individualExtent x // 2. offsety := (self v labelsStyle individualExtent y // 2) + 5. self h unit notNil ifTrue: [offsetx := offsetx + 7 + (self h unitStyle extent x )]. self v unit notNil ifTrue: ["Since the last label can be at the end I have to have room for the whole unit" offsety := offsety + (self v unitStyle extent y)]. self h scale incrementalScaled ifTrue: [op := op + (self horizontalMargin @ 0). cp := cp + (offsetx @ 0)] ifFalse: [cp := cp + (self horizontalMargin @ 0). op := op + (offsetx @ 0)]. self v scale incrementalScaled ifTrue: [op := op + (0 @ self verticalMargin). cp := cp + (0 @ offsety)] ifFalse: [cp := cp + (0 @ self verticalMargin). op := op + (0 @ offsety)]. cp := cp max: 2@2. op := op max: 2@2. self insetBounds: (boundingBox insetOriginBy: op cornerBy: cp)
insetBounds "Answer a Rectangle represents the receiver's insetBounds (in destination coodinate system)" ^Rectangle origin: self h scale destMin @ self v scale destMin corner: self h scale destMax @ self v scale destMax
insetBounds: aRectangle "Make the argument, aRectangle, the receiver's insetBounds" self h scale destMin: aRectangle left max: aRectangle right. self v scale destMin: aRectangle top max: aRectangle bottom.
preferredBounds ^self insetBounds expandedBy: self horizontalMargin@self verticalMargin
</methods> <methods> UI.BG_ChartGrid <category>animation</category>
follow: locationBlock while: durationBlock on: aGraphicsContext
moveTo: newLoc on: aGraphicsContext restoring: backGC
</methods> <methods> UI.BG_ChartGrid <category>utility</category>
box: box by: angle origin: originPoint alignment: alignment | rorigin ang as ai ad d delta idx dpi qpi | ang := angle degreesToRadians. rorigin := originPoint isZero ifTrue: [originPoint] ifFalse: [(self rotatePoint: originPoint by: ang origin: 0@0) rounded]. alignment = 5 ifTrue: [^box align: box center with: rorigin]. "center" as := #(topLeft topCenter topRight leftCenter center rightCenter bottomLeft bottomCenter bottomRight). ad := #(0 0 0.5 0.5 0 0 -0.5 -0.5). ai := #(1 2 3 6 9 8 7 4). dpi := 2 * Float pi. qpi := 1 /4 * Float pi. idx := (ai indexOf: alignment) + (ang \\ dpi // qpi) - 1 \\ 8 + 1. delta := 0@0. d := ang \\ dpi \\ qpi / qpi. d = 0 ifFalse: [delta := ((ad at: idx + 1 \\ 8 +1)@(ad at: idx) * box extent * d) rounded]. ^box align: (box perform: (as at: (ai at: idx))) + delta with: rorigin
displayLabel: aVisualComponent angle: angle offset: offset alignment: alignment on: aGraphicsContext at: aPoint aVisualComponent displayOn: aGraphicsContext at: aPoint + (self box: aVisualComponent bounds by: angle origin: offset alignment: alignment) origin
rotatePoint: aPoint by: angle origin: originPoint | p px py | angle \\ (2 * Float pi) = 0 ifTrue: [^aPoint]. p := aPoint- originPoint. px := (angle cos * p x) - (angle sin * p y). py := (angle cos * p y) + (angle sin * p x). ^(px@py) + originPoint
</methods> <methods> UI.BG_ChartGrid <category>applying transform</category>
applyInverseTo: aPoint | p | p := transposed ifTrue: [aPoint transpose] ifFalse: [aPoint]. p := (x scale applyInverseTo: p x)@(y scale applyInverseTo: p y). ^p
applyInverseToValues: collectionOfPoint ^collectionOfPoint collect: [:each | self applyInverseTo: each]
applyTo: aPoint | p | p := (x scale applyTo: aPoint x)@(y scale applyTo: aPoint y). transposed ifTrue: [p := p transpose]. ^p
applyToValues: collectionOfPoint ^collectionOfPoint collect: [:each | self applyTo: each]
</methods> <methods> UI.BG_ChartGrid <category>private</category>
horizontalMargin "Answer the maximum of title plus labels or unit and labels." | h v vte ext labExt | v := self v. h := self h. vte := v titleStyle extent. labExt := v labelsMarkAt == #noMarks ifTrue: [0] ifFalse: [v labelsStyle individualExtent x]. ext := v labelsMarkAt == #noMarks ifTrue: [0] ifFalse: [v unitStyle extent x]. ext := ext max: (v titleStyle rotation = 0 ifTrue: [vte y] ifFalse: [vte x]). ^5 + (ext + labExt max: (h labelsStyle individualExtent x // 2))
minimumExtent | h v vte hte | h := self h. v := self v. vte := v titleStyle extent. hte := h titleStyle extent. ^(((v titleStyle rotation = 0 ifTrue: [vte y] ifFalse: [vte x]) + v labelsStyle individualExtent x + 10 * 2 max: (h titleStyle rotation = 0 ifTrue: [hte x] ifFalse: [hte y])) max: (h labelsStyle individualExtent x max: h unitStyle extent x)) @ (((h titleStyle rotation = 0 ifTrue: [hte y] ifFalse: [hte x]) + h labelsStyle individualExtent y + 10 * 2 max: (v titleStyle rotation = 0 ifTrue: [vte x] ifFalse: [vte y])) max: (v labelsStyle individualExtent y max: v unitStyle extent y))
verticalMargin "Answer amximum of unit y and labels y plus title." | h v hte | h := self h. v := self v. hte := h titleStyle extent. ^(h titleStyle rotation = 0 ifTrue: [hte y] ifFalse: [hte x]) + h labelsStyle individualExtent y + 10 max: (v labelsStyle individualExtent y max: v unitStyle extent y)
</methods> <methods> UI.BG_ChartGrid <category>testing</category>
transposed "Answer true if the receiver is transposed" ^transposed
</methods> <methods> UI.BG_ChartGrid <category>initialize-release</category>
initialize x := BG_ChartAxis new. y := BG_ChartAxis new. transposed := false.
newGraphicsDevice: aGraphicsDevice x newGraphicsDevice: aGraphicsDevice. y newGraphicsDevice: aGraphicsDevice.
</methods> <methods> UI.BG_ChartGrid <category>bounds clipping</category>
gcCopyClipped: aGraphicsContext "Copy the GraphicsContext, limiting the display area to the area inside the grid axes. Use this limited GraphicsContext when displaying data." ^aGraphicsContext copy intersectClip: (Rectangle left: self h scale destMin rounded right: self h scale destMax rounded top: self v scale destMin rounded bottom: self v scale destMax rounded)
</methods> <methods> UI.BG_ChartPolarGrid <category>accessing</category>
center ^center
center: aPoint radius: anInteger center := aPoint. y scale destMin: 0 max: anInteger
r ^y
r: anAxis "Make the argument, anAxis, the receiver's r axis" y := anAxis
radius ^y scale destLength
startAngle ^x scale destMin
startAngle: anAngle1 stopAngle: anAngle2 x scale destMin: anAngle1 max: anAngle2
stopAngle ^x scale destMax
theta ^x
theta: anAxis "Make the argument, anAxis, the receiver's theta axis" x := anAxis
transpose "The receiver can't transpose axis"
xyRate ^xyRate
xyRate: aPositiveFloat aPositiveFloat > xyRate ifTrue: [self center: self center radius: self radius * xyRate / aPositiveFloat]. xyRate := aPositiveFloat
</methods> <methods> UI.BG_ChartPolarGrid <category>displaying</category>
displayHAxisOn: aGraphicsContext | ts rs arc line angle beginPoint endPoint sy rx ry | ts := x scale. rs := y scale. sy := ((rs includesZero and: [rs zero ~= rs sourceMin & (rs zero ~= rs sourceMax)]) and: [y isAutoLabeled]) ifTrue: [rs zero] ifFalse: [rs incrementalScaled ifTrue: [rs sourceMax] ifFalse: [rs sourceMin]]. "Display axis line" x axisLine isPathVisible ifTrue: [ry := (rs applyTo: sy) - rs destMin. rx := ry * self xyRate. arc := EllipticalArc boundingBox: (center - (rx@ry) extent: (rx@ry)*2) startAngle: self startAngle sweepAngle: self stopAngle - self startAngle. (BG_ChartElement on: arc) fillInside: false; displayOn: aGraphicsContext]. "Display major tick mark" (line := x majorTick) isPathVisible ifTrue: [line := line component. beginPoint := rs incrementalScaled ifTrue: [line start transpose] ifFalse: [line start transpose negated]. endPoint := rs incrementalScaled ifTrue: [line end transpose] ifFalse: [line end transpose negated]. ts majorMarks do: [:mx | | p | angle := (ts applyTo: mx) degreesToRadians. (p := self applyTo: mx@sy) ~= center ifTrue: [(LineSegment from: (self rotatePoint: beginPoint by: angle origin: 0@0) rounded to: (self rotatePoint: endPoint by: angle origin: 0@0) rounded) asStroker displayOn: aGraphicsContext at: p rounded]]]. "Display minor tick marks" ((line := x minorTick) isPathVisible and: [ts div ~= 1]) ifTrue: [line := line copy component: line component copy. beginPoint := rs incrementalScaled ifTrue: [line component start transpose] ifFalse: [line component start transpose negated]. endPoint := rs incrementalScaled ifTrue: [line component end transpose] ifFalse: [line component end transpose negated]. ts minorMarks do: [:mx | | p | angle := (ts applyTo: mx) degreesToRadians. (p := self applyTo: mx@sy) ~= center ifTrue: [line component setStart: (self rotatePoint: beginPoint by: angle origin: 0@0) rounded end: (self rotatePoint: endPoint by: angle origin: 0@0) rounded. line displayOn: aGraphicsContext at: p rounded]]].
displayHLabelsOn: aGraphicsContext | gc ts rs marks images alignment offset sy size | ts := x scale. rs := y scale. alignment := rs incrementalScaled ifTrue: [4] ifFalse: [6]. offset := rs incrementalScaled ifTrue: [5@0] ifFalse: [-5@0]. sy := ((rs includesZero and: [rs zero ~= rs sourceMin & (rs zero ~= rs sourceMax)]) and: [x isAutoLabeled]) ifTrue: [rs zero] ifFalse: [rs incrementalScaled ifTrue: [rs sourceMax] ifFalse: [rs sourceMin]]. "Display axis labels" marks := x labelsMarks. gc := aGraphicsContext copy. images := x labelsStyle individualImages. (size := marks size min: images size) = 0 ifFalse: [((x labels at: 1) = nil or: [(x labels at: size) = nil]) ifFalse: [| fa la | fa := (ts applyTo: (marks at: 1)) \\ 360. la := (ts applyTo: (marks at: size)) \\ 360. fa = la ifTrue: [| delta | delta := (rs incrementalScaled ifTrue: [10] ifFalse: [15]) * (ts incrementalScaled ifTrue: [1] ifFalse: [-1]). marks at: 1 put: (ts applyInverseTo: fa + delta). marks at: size put: (ts applyInverseTo: la - delta)]]. 1 to: size do: [:i | self displayLabel: (images at: i) angle: (ts applyTo: (marks at: i)) offset: offset alignment: alignment on: gc at: (self applyTo: (marks at: i) @ sy) rounded]]. "Display axis unit --- skip" "Display axis title" x title notNil ifTrue: [x titleStyle scale: 1@1. x titleStyle displayOn: aGraphicsContext at: self insetBounds bottomCenter + (x titleStyle width // -2@(x labelsStyle individualExtent y +5))].
displayHLinesOn: aGraphicsContext | rs block marks | rs := y scale. block := [:ry | | rx arc | rx := ry * self xyRate. arc := EllipticalArc boundingBox: (center - (rx @ ry) extent: rx @ ry * 2) startAngle: self startAngle sweepAngle: self stopAngle - self startAngle. arc := BG_ChartElement on: arc. arc fillInside: false; displayOn: aGraphicsContext]. "Display section lines" y sectionLine isPathVisible ifTrue: [marks := (rs applyToValues: y sectionMarks) collect: [:n | n - rs destMin]. 1 to: marks size do: [:i | block value: (marks at: i)]]. "Display border lines" y borderLine isPathVisible ifTrue: [marks := rs applyToValues: rs edgeMarks. block value: marks first. block value: marks last]
displayVAxisOn: aGraphicsContext | ts rs line marksX angle beginPoint endPoint sx | ts := x scale. rs := y scale. sx := ts includesZero ifTrue: [ts zero] ifFalse: [ts incrementalScaled ifTrue: [ts sourceMin] ifFalse: [ts sourceMax]]. "Display axis line" (line := y axisLine) isPathVisible ifTrue: [(LineSegment from: (self applyTo: sx@rs sourceMax) rounded to: (self applyTo: sx@rs sourceMin) rounded) asStroker displayOn: aGraphicsContext]. "Display major tick mark" marksX := ts majorMarks. (line := y majorTick) isPathVisible ifTrue: [beginPoint := line component start. endPoint := line component end. marksX do: [:mx | angle := (ts applyTo: mx) degreesToRadians. line := LineSegment from: (self rotatePoint: beginPoint by: angle origin: 0@0) rounded to: (self rotatePoint: endPoint by: angle origin: 0@0) rounded. rs majorMarks do: [:my | | p | (p := self applyTo: mx@my) ~= center ifTrue: [line asStroker displayOn: aGraphicsContext at: p rounded]]]]. "Display minor tick mark" ((line := y minorTick) isPathVisible and: [rs div ~= 1]) ifTrue: [line := line copy component: line component copy. beginPoint := line component start. endPoint := line component end. marksX do: [:mx | angle := (ts applyTo: mx) degreesToRadians. line component setStart: (self rotatePoint: beginPoint by: angle origin: 0@0) rounded end: (self rotatePoint: endPoint by: angle origin: 0@0) rounded. rs minorMarks do: [:my | | p | (p := self applyTo: mx@my) ~= center ifTrue: [line displayOn: aGraphicsContext at: p rounded]]]].
displayVLabelsOn: aGraphicsContext | gc ts rs marks images angle alignment offset sx sizeOfLabels | "Display axis labels" ts := x scale. rs := y scale. alignment := ts incrementalScaled ifTrue: [8] ifFalse: [2]. offset := ts incrementalScaled ifTrue: [0@-5] ifFalse: [0@5]. marks := y labelsMarks. gc := aGraphicsContext copy. images := y labelsStyle individualImages. sx := ts includesZero ifTrue: [ts zero] ifFalse: [ts incrementalScaled ifTrue: [ts sourceMin] ifFalse: [ts sourceMax]]. angle := ts applyTo: sx. sizeOfLabels := marks size min: images size. 1 to: sizeOfLabels do: [:i | self displayLabel: (images at: i) angle: angle offset: offset alignment: alignment on: gc at: (self applyTo: sx@(marks at: i)) rounded]. "Display axis unit" y unit notNil ifTrue: [self displayLabel: y unitStyle angle: angle offset: offset + ((images at: sizeOfLabels) bounds extent x // 2 + 5@0) alignment: (ts incrementalScaled ifTrue: [7] ifFalse: [1]) on: aGraphicsContext at: (self applyTo: sx@(marks at: sizeOfLabels)) rounded]. "Display axis title" y title notNil ifTrue: [ | lh image | lh := y labelsStyle individualExtent x. alignment := ts incrementalScaled ifTrue: [8] ifFalse: [2]. offset := rs destLength // 2@(ts incrementalScaled ifTrue: [-5-lh] ifFalse: [5+lh]). image := y titleStyle. image scale: 1@1. image rotation: (angle degreesToRadians sin abs > (0.25 * Float pi) sin ifTrue: [3] ifFalse: [0]). self displayLabel: image angle: angle offset: offset alignment: alignment on: aGraphicsContext at: self center].
displayVLinesOn: aGraphicsContext | rs line marks block | rs := y scale. line := x sectionLine. block := [:sx :gc | line component: (LineSegment from: (self applyTo: sx @ rs sourceMax) rounded to: (self applyTo: sx @ rs sourceMin) rounded). line displayOn: gc]. "Display section lines" line isPathVisible ifTrue: [marks := x sectionMarks. 1 to: marks size do: [:i | block value: (marks at: i) value: aGraphicsContext]]. "Display border lines" (line := x borderLine) isPathVisible ifTrue: [marks := x scale edgeMarks. block value: marks first value: aGraphicsContext. block value: marks last value: aGraphicsContext]
</methods> <methods> UI.BG_ChartPolarGrid <category>bounds accessing</category>
insetBounds | length | length := self radius * xyRate@self radius. ^center - length extent: length * 2
insetBounds: aRectangle | radius | radius := aRectangle height // 2 max: 1. self center: aRectangle center radius: radius. xyRate := (aRectangle width / (radius * 2)) asFloat.
</methods> <methods> UI.BG_ChartPolarGrid <category>testing</category>
transposed ^false
</methods> <methods> UI.BG_ChartPolarGrid <category>applying transform</category>
applyInverseTo: aPoint | d t r m | d := aPoint - center. m := (self startAngle + self stopAngle / 2) degreesToRadians. t := d theta + (m // (2 * Float pi) * (2 * Float pi)). t > (m + Float pi) ifTrue: [t := t - (2 * Float pi)] ifFalse: [t < (m - Float pi) ifTrue: [t := t + (2 * Float pi)]]. r := d r. t := t radiansToDegrees. ^(x scale applyInverseTo: t)@(y scale applyInverseTo: r)
applyTo: aPoint | r t | t := (x scale applyTo: aPoint x) degreesToRadians. r := y scale applyTo: aPoint y. ^(t cos * xyRate@t sin) * r + center
</methods> <methods> UI.BG_ChartPolarGrid <category>initialize-release</category>
initialize super initialize. self startAngle: 0 stopAngle: 360. xyRate := 1. y tickCross
</methods> <methods> UI.BG_ChartPolarGrid <category>bounds clipping</category>
gcCopyClipped: aGraphicsContext ^aGraphicsContext
</methods> <methods> UI.BG_Label <category>visual properties</category>
foregroundColor ^foregroundColor
foregroundColor: aColor foregroundColor := aColor
lookPreferences | lp | lp := LookPreferences defaultForWindows. lp := lp foregroundColor: foregroundColor. ^lp
lookPreferences: aLookPreferences self foregroundColor: aLookPreferences foregroundColor
setColorOn: aGraphicsContext "Set the receiver's color on aGraphicsContext" (foregroundColor ~~ nil and: [foregroundColor ~~ aGraphicsContext paint]) ifFalse: [^self]. [aGraphicsContext paint: foregroundColor] on: Error do: [:ex | ex return]
</methods> <methods> UI.BG_Label <category>bounds accessing</category>
bottom ^self top + self height
bounds: newBounds self extent: newBounds extent
extent ^extent isNil ifTrue: [self image bounds extent] ifFalse: [extent]
extent: aPoint "Set the receiver's extent to be aPoint." extent := aPoint
height ^self extent y
height: aHeight "Set the height of the receiver's bounding box to be aHeight." self extent: self width@aHeight
left ^0
preferredBounds "Answer the receiver's actual bounding rectangle." ^Rectangle origin: 0@0 extent: self extent
right ^self left + self width
top ^0
topLeft ^0@0
width ^self extent x
width: aWidth "Set the width of the receiver's bounding box to be aWidth." self extent: aWidth@self height
</methods> <methods> UI.BG_Label <category>private</category>
alignmentForDisplay "Answer Integer that represents alignment for displaying" | al | ^(al := self alignment) = 0 ifTrue: [(item isKindOf: Number) ifTrue: [3] ifFalse: [1]] ifFalse: [al]
alignmentForTextStyle "Answer Integer that represents alignment for TextStyle" ^#[1 0 2] at: self alignmentForDisplay \\ 3 + 1
alignOffset: alignedObject | al x y ax ay | x := y := 0. al := self alignmentForDisplay. (ax := al \\ 3) = 1 ifFalse: [ | width ext | ext := self extent. width := alignedObject bounds width. ax = 2 ifTrue: [x := ext x - width // 2] ifFalse: [x := ext x - width]]. (ay := al - 1 // 3) = 0 ifFalse: [ | height ext | ext := self extent. height := alignedObject bounds height. ay = 1 ifTrue: [y := ext y - height // 2] ifFalse: [y := ext y - height]]. ^x@y
compose "Cache the form for displaying the object." | str | item isNil ifTrue: [^image := '' asComposedText]. (item isKindOf: VisualComponent) ifTrue: [^image := item]. textStyle alignment: self alignmentForTextStyle. str := self composeString. (str includes: Character cr) ifTrue: [image := ComposedText withText: (Text string: str emphasis: emphasis) style: textStyle] ifFalse: [image := BG_TextLabel with: (Text string: str emphasis: emphasis) attributes: textStyle]
composeString | string | item isString ifTrue: [string := item] ifFalse: [(item isKindOf: Number) ifTrue: [string := self stringFromNumber: item] ifFalse: [(item isMemberOf: Point) ifTrue: [string := self stringFromPoint: item] ifFalse: [(item isKindOf: Text) ifTrue: [string := self stringFromText: item] ifFalse: [([string := item printString] on: Error do: [:ex | ex returnWith: #bad]) == #bad ifTrue: [string := 'a ' , item class printString]]]]]. ^(decoration isNil or: [decoration isEmpty or: [string isEmpty]]) ifTrue: [string] ifFalse: [decoration copyReplaceAll: '#' with: string]
formatConstraintCheck: aSymbol "Check format type constraint. see class initialize FormatConstraint" | v o | o := self format. v := FormatConstraint at: aSymbol ifAbsent: [^o]. ^(o bitAnd: (v at: 2)) bitOr: (v at: 1)
formatTypes: aSet "Set format types to be aSet" aSet do: [:c | self formatType: c]
stringFromNumber: aNumber | n type s base | (type := format bitAnd: 2r111111100) = 0 ifTrue: [^aNumber printString]. n := aNumber. (type anyMask: 2r001000000) ifTrue: [n := n *100]. (type anyMask: 2r000000100) ifTrue: [n := n asFloat] ifFalse: [(type anyMask: 2r110001000) ifTrue: [n := n rounded asInteger]]. (n = 0 and: [type anyMask: 2r000010000]) ifTrue: [^'']. (type anyMask: 2r100000000) ifTrue: [n > 100 ifTrue: [base := 10 raisedTo: (n log: 10) truncated - 1. n := (n / base) rounded]. ^n > 0 ifTrue: [String new: n withAll:$*] ifFalse: ['']]. (type anyMask: 2r010000000) ifTrue: [s := self withComma: n] ifFalse: [(type anyMask: 2r000001000) ifTrue: [s := n printString] ifFalse: [(type anyMask: 2r000000100) ifTrue: [s := self withFloat: n] ifFalse: [s := n printString]]]. ((type anyMask: 2r000100000) and: [n > 0]) ifTrue: [s := '+', s]. (type anyMask: 2r001000000) ifTrue: [s := s , '%']. ^s
stringFromPoint: aPoint (aPoint isZero and: [format anyMask: 2r000010000]) ifTrue: [^'']. "zero" ^(self stringFromNumber: aPoint x) , '@' , (self stringFromNumber: aPoint y)
stringFromText: aText ^aText string
withComma: anInteger "Answer a string representing anInteger " | s size n r | s := anInteger abs printString. (size := s size) <= 3 ifTrue: [^anInteger printString]. n := size - ((size // 3) * 3). r := (n =0) ifTrue: [''] ifFalse: [s copyFrom: 1 to: n]. n + 1 to: size by: 3 do: [:i | (i=1) ifFalse: [r := r , ',']. r := r , (s copyFrom: i to: i+2)]. anInteger negative ifTrue: [r := '-' , r]. ^r
withFloat: aFloat "Answer the string represented aFloat as fixed-decimal point" | f s n length | length := self decimalPartLength. f := aFloat asFloat. length = 0 ifTrue: [^f printString] ifFalse: [s := (f roundTo: 1 / (10 raisedTo: length) asFloat) printString. s ='0' ifTrue: [s := '0.0']. ^s , ((n := s size - (s indexOf: $.)) < length ifTrue: [String new: length - n withAll: $0] ifFalse: [''])]
</methods> <methods> UI.BG_Label <category>format/decoration</category>
alignment ^format bitShift: -9
alignment: anInteger "Set the current setting of the alignment to be anInteger-- 0: default (if item is kind of number, then alignment is same to 3 , otherwise is 1). 1: top left (left flush) 2: top center (centered) 3: top right (right flush) 4: left center 5: center 6: right center 7: bottom left 8: bottom center 9: bottom right" format := (format bitAnd: 2r111111111) bitOr: (anInteger bitShift: 9). self flushCaches
asterisk "Add asterisk type to current display formats." self formatType: #asterisk
comma "Add comma type to current display formats" self formatType: #comma
decimalPartLength "Answer decimal-part length" ^self format bitAnd: 2r11
decimalPartLength: anInteger "Make argument, anInteger, decimal-part length" | order | order := anInteger \\ 3. format := (self format bitAnd: 2r111111100) bitOr: order. self flushCaches
decoration ^decoration
decoration: aString "Make the argument, aString, the receiver's decoration" decoration := aString. self flushCaches
float "Add float type to current display formats" self formatType: #float
format "Answer the receiver's format" ^format
formatType: typeChar "Add typeChar to the receiver format after checking type constarain" format := self formatConstraintCheck: typeChar. self flushCaches
formatTypes "Answer current format types set" | f s n | f := (format bitAnd: 2r111111100) bitShift: -2. f = 0 ifTrue: [^Set with: #general]. s := Set new. n :=1. #(float integer zerosuppress sign percent comma asterisk) do: [:c | (f anyMask: n) ifTrue: [s add: c]. n := n bitShift: 1]. ^s
general "Add general type to current display formats." self formatType: #general
integer "Add integer type to curren display formats" self formatType: #integer
percent "Add percent type to current display formats" self formatType: #percent
sign "Add sign type to current display formats" self formatType: #sign
zerosuppress "Add zero suppress type to current display formats" self formatType: #zerosuppress
</methods> <methods> UI.BG_Label <category>copying</category>
postCopy textStyle := textStyle copy
</methods> <methods> UI.BG_Label <category>displaying</category>
displayOn: aGraphicsContext "Display the receiver on aGraphicsContext" self displayOn: aGraphicsContext at: Point zero
displayOn: aGraphicsContext at: aPoint "Display the receiver on aGraphicsContext translated by aPoint." | gc | item isNil ifTrue: [^self]. gc := aGraphicsContext copy. self setColorOn: gc. extent ~~ nil ifTrue: [gc intersectClip: (Rectangle origin: aPoint extent: extent). self image displayOn: gc at: aPoint + (self alignOffset: image)] ifFalse: [self image displayOn: gc at: aPoint]
</methods> <methods> UI.BG_Label <category>text style/emphasis</category>
emphasis ^emphasis
emphasis: code "Set the emphasis. code is same as emphasis of Text" emphasis := code. self flushCaches
indent: anInteger "Set the all indent of style" textStyle firstIndent: anInteger; restIndent: anInteger; rightIndent: anInteger. self flushCaches
textStyle ^textStyle
textStyle: aTextAttributes "Set the style by which the receiver should display its item." textStyle := aTextAttributes. self flushCaches
</methods> <methods> UI.BG_Label <category>initialize-release</category>
flushCaches "Forget the receiver's image." image := nil
initialize super initialize. textStyle := TextAttributes default. format := 0
newGraphicsDevice: aGraphicsDevice self image newGraphicsDevice: aGraphicsDevice.
</methods> <methods> UI.BG_Label <category>accessing</category>
image "Answer the visual component containing the composed item." image isNil ifTrue: [self compose]. ^image
item ^item
item: anObject "Make the argument, anObject, the receiver's item" item := anObject. self flushCaches
</methods> <methods> UI.BG_Label class <category>class initialization</category>
initialize "BG_Label initialize" FormatConstraint := Dictionary new: 8. FormatConstraint at: #general put: (Array with: 2r000000000 with: 2r1111000000011). "all" FormatConstraint at: #asterisk put: (Array with: 2r100000000 with: 2r1111100011011). "#(comma float percent sign)" FormatConstraint at: #comma put: (Array with: 2r010000000 with: 2r1111011111011). "#(asterisk float)" FormatConstraint at: #percent put: (Array with: 2r001000000 with: 2r1111011111111). "#(asterisk)" FormatConstraint at: #sign put: (Array with: 2r000100000 with: 2r1111011111111). "#(asterisk)" FormatConstraint at: #zerosuppress put: (Array with: 2r000010000 with: 2r1111111111111). "#()" FormatConstraint at: #integer put: (Array with: 2r000001000 with: 2r1111111111011). "#(float)" FormatConstraint at: #float put: (Array with: 2r000000100 with: 2r1111001110111). "#(asterisk comma integer)"
</methods> <methods> UI.BG_Label class <category>instance creation</category>
item: anObject "Answer an instance of the receiver with displaying item" ^self new item: anObject
</methods> <methods> UI.BG_Banner <category>rotation/scale</category>
autoScale isAutoScaled := true. scale := nil
isAutoScaled ^isAutoScaled
rotation ^rotation
rotation: anInteger "Make the argument anInteger the receiver's rataion. anInteger = 0 means unchanged, 1 means clockwise 90 degrees, and so on" rotation := anInteger. self flushCaches
rotationForDisplay ^(rotation odd and: ['ja_*' match: Locale current name]) ifTrue: [0] ifFalse: [rotation]
scale ^scale
scale: aPoint "Make the argument aPoint the receiver's scale and reset auto scale" scale := aPoint. isAutoScaled := false. self flushCaches
</methods> <methods> UI.BG_Banner <category>bounds accessing</category>
extent: aPoint "Set the point that represents the width and height of the receiver" aPoint ~= extent ifTrue: [extent := aPoint. self flushCaches]
</methods> <methods> UI.BG_Banner <category>private</category>
compose "Cache the image for displaying the object." | rot isText | super compose. image bounds extent isZero ifTrue: [^self]. rot := self rotationForDisplay. (rot isZero and: [isAutoScaled not and: [scale = (1 @ 1)]]) ifTrue: [^self]. isText := image respondsTo: #text. (item isKindOf: Image) ifFalse: [| mask | mask := Pixmap extent: image extent. super displayOn: mask graphicsContext at: Point zero. image := mask asImage. mask close]. rot isZero ifFalse: [image := image rotatedByQuadrants: rot]. (isAutoScaled not and: [scale = (1 @ 1)]) ifFalse: [image := image shrunkenBy: (isAutoScaled ifTrue: [image extent / self extent] ifFalse: [1.0 @ 1.0 / scale])]. "Use an OpaqueImage to subtract background from text" image := isText ifTrue: [| shape | shape := image convertToPalette: CoveragePalette monoMaskPalette renderedBy: NearestPaint new paintTransfer: [:paint | paint = ColorValue white ifTrue: [CoverageValue transparent] ifFalse: [CoverageValue opaque]]. OpaqueImage figure: (CachedImage on: image) shape: (CachedImage on: shape)] ifFalse: [CachedImage on: image]
composeString | s s1 | s := super composeString. self rotationForDisplay = self rotation ifFalse: [s1 := String new writeStream. s do: [:i | s1 nextPut: i] separatedBy: [s1 cr]. s := s1 contents]. ^s
</methods> <methods> UI.BG_Banner <category>initialize-release</category>
initialize super initialize. rotation := 0. isAutoScaled := true.
</methods> <methods> UI.BG_Banner <category>displaying</category>
displayOn: aGraphicsContext at: aPoint "Display the receiver on aGraphicsContext translated by aPoint." | gc | item isNil ifTrue: [^self]. gc := aGraphicsContext copy. self getColorFrom: gc. extent ~~ nil ifTrue: [gc intersectClip: (self bounds translatedBy: aPoint)]. self image displayOn: gc at: aPoint + (self alignOffset: image)
</methods> <methods> UI.BG_Banner <category>visual properties</category>
getColorFrom: aGraphicsContext | currentForeground | currentForeground := aGraphicsContext paint. foregroundColor = currentForeground ifFalse: [foregroundColor := currentForeground. self flushCaches]
</methods> <methods> UI.BG_LineChartView <category>line/marker</category>
chartLookList ^showMarker ifTrue: [LooksForMarkers] ifFalse: [LooksForLines]
hideLine showLine := #hide
hideMarker showMarker := false
isLineVisible ^showLine ~= #hide
isMarkerVisible ^showMarker
lines: collectionOfLines | list lookPreference line | list := collectionOfLines asArray. self composeLooks: list size. 1 to: list size do: [:i | lookPreference := (self looksAt: i) copy. line := list at: i. line isInteger ifTrue: [line := (self chartLookListAt: line) lineWidthAndStyle]. lookPreference lineWidthAndStyle: line. elementLooks at: i put: lookPreference].
lineStyles: collectionOfSymbols | list lookPreference line style | list := collectionOfSymbols asArray. self composeLooks: list size. 1 to: list size do: [:i | lookPreference := (self looksAt: i) copy. line := list at: i. line isNil ifFalse: [style := BG_ChartElement perform: line. lookPreference lineStyle: style. elementLooks at: i put: lookPreference]]
lineType ^showLine
lineWidths: collectionOfSymbols | list lookPreference line | list := collectionOfSymbols asArray. self composeLooks: list size. 1 to: list size do: [:i | lookPreference := (self looksAt: i) copy. line := list at: i. line isNil ifFalse: [lookPreference lineWidth: line. elementLooks at: i put: lookPreference]]
markers: collectionOfIntegers | list lookPreference marker | list := collectionOfIntegers asArray. self composeLooks: list size. 1 to: list size do: [:i | lookPreference := (self looksAt: i) copy. marker := list at: i. marker isNil ifTrue: [marker := i]. marker isInteger ifTrue: [marker := (self chartLookListAt: marker) marker] ifFalse: [marker := BG_DataPointMarker imageAt: marker]. lookPreference marker: marker. elementLooks at: i put: lookPreference]
showLine showLine := #polyline
showMarker showMarker := true
showSpline showLine := #spline
</methods> <methods> UI.BG_LineChartView <category>private</category>
defaultDataAlignment: v ^v >=0 ifTrue: [4] ifFalse: [6]
defaultDataOffset: v offset: offset ^v >=0 ifTrue:[offset@0] ifFalse: [offset negated@0]
displayLineAndMarkerOn: aGraphicsContext at: index points: collectionOfPoints | gc | gc := self setClientDataFor: aGraphicsContext index: index foreground: true. self isLineVisible ifTrue: [| polyline | showLine = #polyline ifTrue: [polyline := Polyline vertices: collectionOfPoints asArray] ifFalse: [polyline := Spline controlPoints: collectionOfPoints]. (BG_ChartElement on: polyline) fillInside: false; displayOn: gc]. showMarker ifTrue: [| dot | dot := (gc clientDataAt: #chartElement) marker. dot isNil ifTrue: [dot := (self chartLookListAt: index) marker]. collectionOfPoints do: [:p | dot displayOn: gc at: p rounded]]
</methods> <methods> UI.BG_LineChartView <category>displaying</category>
displayDataOn: aGraphicsContext | value images angle ofs gc | value := self data. gc := aGraphicsContext copy. images := dataStyle individualImages. angle := self defaultDataAngle. ofs := 7. 1 to: value columnSize do: [:x | 1 to: value rowSize do: [:y | | n v | n := sortedIndex at: x. v := value at: n@y. grid displayLabel: (images at: n@y) angle: angle offset: (self defaultDataOffset: v offset: ofs) alignment: (self defaultDataAlignment: v) on: gc at: (grid applyTo: x@v) rounded]]
displayLegendSymbol: anIndex in: aRectangle on: aGraphicsContext self isLineVisible ifTrue: [ (BG_ChartElement on: (LineSegment from: aRectangle leftCenter to: aRectangle rightCenter)) displayOn: aGraphicsContext]. showMarker ifTrue: [| dot | dot := (aGraphicsContext clientDataAt: #chartElement) marker. dot isNil ifTrue: [dot := (self chartLookListAt: anIndex) marker]. dot displayOn: aGraphicsContext at: aRectangle center]
displayPlotOn: aGraphicsContext | value points collection | value := self data. points := BG_TableAdaptor columns: value columnSize rows: value rowSize. 1 to: value columnSize do: [:x | | n | n := sortedIndex at: x. 1 to: value rowSize do: [:y | points at: x@y put: x@(value at: n@y)]]. collection := grid applyToValues: points. 1 to: value rowSize do: [:y | self displayLineAndMarkerOn: aGraphicsContext at: y points: (collection rowAt: y)]
</methods> <methods> UI.BG_LineChartView <category>initialize-release</category>
initialize super initialize. self showLine. showMarker := false
</methods> <methods> UI.BG_LineChartView <category>color/mask/line/marker</category>
looksType "Answer what kind of looks a chart expects. We distinguish two types: #region for bar and pie charts and #line for line and xy charts. I'm the line chart so the answer is #line" ^#line
</methods> <methods> UI.BG_StepChartView <category>displaying</category>
displayDataOn: aGraphicsContext | value images angle ofs gc | value := self data. gc := aGraphicsContext copy. images := dataStyle individualImages. angle := self defaultDataAngle. ofs := 7. 1 to: value rowSize do: [:y | 1 to: value columnSize do: [:x | | n v | n := sortedIndex at: x. v := value at: n@y. (x = 1 or: [v ~= (value at: (sortedIndex at: x-1)@y)]) ifTrue: [grid displayLabel: (images at: n@y) angle: angle offset: (self defaultDataOffset: v offset: ofs) alignment: (self defaultDataAlignment: v) on: gc at: (grid applyTo: x@v) rounded]]]
displayPlotOn: aGraphicsContext | value points collection | value := self data. points := BG_TableAdaptor columns: value columnSize * 2 rows: value rowSize. 1 to: value columnSize do: [:x | | n | n := sortedIndex at: x. 1 to: value rowSize do: [:y | points at: x *2 -1@y put: x - 0.5 @ (value at: n@y). points at: x *2@y put: x + 0.5@(value at: n@y)]]. collection := grid applyToValues: points. 1 to: value rowSize do: [:y | self displayLineAndMarkerOn: aGraphicsContext at: y points: (collection rowAt: y)]
</methods> <methods> UI.BG_LabelList <category>bounds accessing</category>
computedExtent | ext | ext := 0 @ 0. self individualImages do: [:each | ext := ext + each extent]. ^ext
extent ^extent isNil ifTrue: [self individualExtent * (column@self row)] ifFalse: [extent]
extent: aPoint "Set the point that represents the width and height of the receiver" | iw ih | iw := column > 0 ifTrue: [aPoint x // column] ifFalse: [0]. ih := self row > 0 ifTrue: [aPoint y // self row] ifFalse: [0]. self individualExtent: iw@ih. extent := self extent
individualExtent | ext | individualExtent isNil ifTrue: [ext := 0 @ 0. self individualImages do: [:each | ext := ext max: each extent]. ^ext] ifFalse: [^individualExtent]
individualExtent: aPoint "Set the point that represents the width and height of each label of the receiver" individualExtent := aPoint. extent := nil. super flushCaches
individualImages "Answer the collection of the image containing the composed element of item." individualImages isNil ifTrue: [self compose]. ^individualImages
</methods> <methods> UI.BG_LabelList <category>private</category>
compose "Cache the visual components for displaying the object." | savedItem | item == nil ifTrue: [individualImages := #(). ^self]. savedItem := item. (item isKindOf: BG_TableAdaptor) ifTrue: [individualImages := BG_TableAdaptor columns: item columnSize rows: item rowSize] ifFalse: [individualImages := Array new: item size]. savedItem keysAndValuesDo: [:i :v | item := v. super compose. individualImages at: i put: image]. image := nil. item := savedItem
separate: aString | labels oc rs | (labels := aString) isString ifTrue: [oc := OrderedCollection new. rs := ReadStream on: aString. [rs atEnd] whileFalse: [oc add: (rs upTo: Character cr)]. labels := oc asArray]. ^labels
</methods> <methods> UI.BG_LabelList <category>column</category>
beHorizontal self column: item size
beVertical self column: 1
column ^column
column: anInteger column := anInteger. super flushCaches
isHorizontal ^column = item size
isVertical ^column = 1
row ^(item size / column) ceiling
</methods> <methods> UI.BG_LabelList <category>displaying</category>
displayItemAt: index on: aGraphicsContext self displayItemAt: index on: aGraphicsContext at: Point zero
displayItemAt: index on: aGraphicsContext at: aPoint | gc savedItem savedExtent | item == nil ifTrue: [^self]. self individualImages. savedItem := item. savedExtent := extent. extent := self individualExtent. gc := aGraphicsContext copy. self setColorOn: gc. gc intersectClip: (Rectangle origin: aPoint extent: extent). item := savedItem at: index. image := individualImages at: index. image displayOn: gc at: aPoint + (self alignOffset: image). item := savedItem. extent := savedExtent.
displayOn: aGraphicsContext at: aPoint "Display the receiver on aGraphicsContext translated by aPoint." | gc row savedItem savedExtent clippingBox iw ih | (item isNil or: [item isEmpty]) ifTrue: [^self]. individualImages isNil ifTrue: [self compose]. row := self row. savedItem := item. gc := aGraphicsContext copy. self setColorOn: gc. extent ~~ nil ifTrue: [gc intersectClip: (self bounds translatedBy: aPoint)]. savedExtent := extent. extent := self individualExtent. clippingBox := gc clippingBounds translatedBy: aPoint negated. iw := extent x. ih := extent y. (clippingBox left // iw max: 0) to: (clippingBox right // iw min: column -1) do: [:c | (clippingBox top // ih max: 0) to: (clippingBox bottom // ih min: row -1) do: [:r | | i | i := r * column + (c + 1). (i <= savedItem size and: [(item := savedItem at: i) notNil]) ifTrue: [image := individualImages at: i. image displayOn: gc at: aPoint + ((c@r) * self extent) + (self alignOffset: image)]]]. item := savedItem. extent := savedExtent.
</methods> <methods> UI.BG_LabelList <category>accessing</category>
fitItem item do: [:each | (each isKindOf: BG_Label) ifTrue: [each extent: self individualExtent]]. super flushCaches
item: anObject super item: (self separate: anObject)
lineGrid "Answer the line grid of the receiver." ^self individualExtent y max: 1
numberOfLines "Answer the number of lines of item in the receiver." ^self row
</methods> <methods> UI.BG_LabelList <category>initialize-release</category>
flushCaches super flushCaches. individualImages := nil
initialize super initialize. self beVertical
newGraphicsDevice: aGraphicsDevice self individualImages do:[:each| each newGraphicsDevice: aGraphicsDevice].
</methods> <methods> UI.BG_LabelList <category>line accessing</category>
lineIndexOfTop: top "Answer the line index for the y position aTop." ^(top // self lineGrid + 1 max: 1) min: self numberOfLines
topAtLineIndex: lineIndex "Answer the top y of the line at lineIndex." ^lineIndex - 1 * self lineGrid
visibleRectangleFrom: start to: stop "Answer the rectangle for the lines in the range start to stop." | firstLineIndex lastLineIndex | firstLineIndex := start. firstLineIndex < 1 ifTrue: [firstLineIndex := 1]. lastLineIndex := stop. lastLineIndex > self numberOfLines ifTrue: [lastLineIndex := self numberOfLines]. ^(Rectangle origin: self left @ (self topAtLineIndex: firstLineIndex) corner: self right @ ((self topAtLineIndex: lastLineIndex) + self lineGrid))
</methods> <methods> UI.BG_LabelList class <category>instance creation</category>
onList: aListArray ^self item: aListArray
</methods> <methods> UI.ChartElementLookSpec <category>accessing</category>
backgroundColor ^backgroundColor
backgroundColor: aValue backgroundColor := aValue
foregroundColor ^foregroundColor
foregroundColor: aValue foregroundColor := aValue
lineType ^lineType == #default ifTrue: [nil] ifFalse: [lineType]
lineType: aValue lineType := aValue == #default ifTrue: [nil] ifFalse: [aValue]
lineWidth ^lineWidth isNil ifTrue: [1] ifFalse: [lineWidth]
lineWidth: aValue lineWidth := aValue
markerType ^markerType == #default ifTrue: [nil] ifFalse: [markerType]
markerType: aValue markerType := aValue == #default ifTrue: [nil] ifFalse: [aValue]
pattern ^pattern
pattern: aValue "Pattern number one is a default pattern. Instead of setting the default use nil." pattern := aValue == 1 ifTrue: [nil] ifFalse: [aValue]
</methods> <methods> UI.ChartElementLookSpec <category>private-interface building</category>
addAspectsForLineTo: builder builder aspectAt: #lineStyle put: (self class adapt: self forAspect: #lineType channel: nil). builder aspectAt: #lineStyleMenu put: self class lineStyleMenu. builder aspectAt: #markerStyle put: (self class adapt: self forAspect: #markerType channel: nil). builder aspectAt: #markerStyleMenu put: self class markerStyleMenu. builder aspectAt: #lineWidth put: (self class adapt: self forAspect: #lineWidth channel: nil)
addAspectsForRegionTo: builder 1 to: BG_ChartElement patternsSize do: [:i | builder visualAt: ('i' , i printString) asSymbol put: ((BG_ChartElement patternAt: i) magnifiedBy: 2 @ 2). builder aspectAt: ('m' , i printString) asSymbol put: [self pattern: i. (builder aspectAt: #accept) value]]
dialogFor: aDialogType | builder dialog spec result | builder := (dialog := SimpleDialog new) builder. builder aspectAt: #accept put: [result := true. dialog close]. builder aspectAt: #cancel put: [result := false. dialog close]. aDialogType == #region ifTrue: [self addAspectsForRegionTo: builder. spec := self class regionLookSpec]. aDialogType == #line ifTrue: [self addAspectsForLineTo: builder. spec := self class lineLookSpec]. dialog allButOpenFrom: (UISpecification from: spec). builder openDialog. ^result
insertIntoDescriptor: aDataDescriptor foregroundColor isNil ifFalse: [aDataDescriptor foregroundColor: foregroundColor]. backgroundColor isNil ifFalse: [aDataDescriptor backgroundColor: backgroundColor]. pattern isNil ifFalse: [aDataDescriptor pattern: pattern]. markerType isNil ifFalse: [aDataDescriptor markerType: markerType]. lineType isNil ifFalse: [aDataDescriptor lineType: lineType]. lineWidth isNil ifFalse: [aDataDescriptor lineWidth: lineWidth].
</methods> <methods> UI.ChartElementLookSpec <category>copying</category>
postCopy foregroundColor := foregroundColor copy. backgroundColor := backgroundColor copy
</methods> <methods> UI.ChartElementLookSpec <category>private</category>
fromLiteralArrayEncoding: anArray super fromLiteralArrayEncoding: anArray. "Foreground and background colors are literal arrays at this point. I have to decode them." foregroundColor := foregroundColor decodeAsLiteralArray. backgroundColor := backgroundColor decodeAsLiteralArray.
</methods> <methods> Examples.BG_Chart1 <category>update</category>
update | rnd max | rnd := Random new. max := 20. 1 to: 3 do: [:i | | index | index := (rnd next * self data size) floor + 1. self data at: index put: max * rnd next]
</methods> <methods> Examples.BG_Chart1 <category>data</category>
data ^data
</methods> <methods> Examples.BG_Chart1 <category>initialize</category>
initialize super initialize. data := List new. 1 to: 10 do: [:i | data add: i]
</methods> <methods> Examples.BG_Chart1 class <category>markedAsSystemClass</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.ChartingScaleSpec <category>private</category>
simplified "Remove the base definition if the scale type is normal. If the auto scale flag is on, also remove the of max, min, and step definitions." self scaleType == #normal ifTrue: [base := nil. scaleType := nil]. (restrictions notNil and: [restrictions isEmpty]) ifTrue: [restrictions := nil]. ^super simplified
</methods> <methods> UI.ChartingScaleSpec <category>accessing</category>
addRestrictions: aCollection self restrictions: (self restrictions asSet addAll: aCollection; asArray)
autoScale "Nil and true return true" (self restrictions includes: #auto) ifTrue: [^true]. ^autoScale ~= false
autoScale: aValue autoScale := aValue
autoScaleSet "Return the state of the autoScale variable. Return true if autoScale is not nil. Specs need to distinguish when its value is nil" (self restrictions includes: #auto) ifTrue: [^false]. ^autoScale notNil
base ^base
base: aValue base := aValue
getMax "Always answer a number. If the instance variable is nil answer 0." ^max isNil ifTrue: [100] ifFalse: [max].
getMin "Always answer a number. If the instance variable is nil answer 0." ^min isNil ifTrue: [0] ifFalse: [min].
getZero "Always answer a number. If the instance variable is nil answer 0." ^zero isNil ifTrue: [self getMin] ifFalse: [zero].
invert ^invert == true
invert: aValue invert := aValue
max ^max
max: aValue max := aValue
min ^min
min: aValue min := aValue
minorDivisions ^minorDivisions
minorDivisions: aValue minorDivisions := aValue
restrictions ^restrictions isNil ifTrue: [#()] ifFalse: [restrictions].
restrictions: aValue restrictions := aValue
scaleType "Nil or #normal return #normal" scaleType isNil ifTrue: [^#normal]. ^scaleType
scaleType: aValue scaleType := aValue
step ^step
step: aValue step := aValue
zero ^zero
zero: aValue zero := aValue
</methods> <methods> UI.ChartingScaleSpec <category>private-interface building</category>
insertIntoScale: aScale | setStep | setStep := false. self autoScale ifFalse: [ (min notNil and: [max notNil]) ifTrue: [aScale sourceMin: min max: max. zero isNil ifTrue: [aScale zero: min]. setStep := true]. (step notNil and: [step isZero not]) ifTrue: [aScale step: step] ifFalse: [setStep ifTrue: [| st | st := (max - min // 5) abs. aScale step: st]]]. ((self restrictions includes: #zero) or: [zero isNil]) ifFalse: [aScale zero: zero]. (minorDivisions notNil and: [minorDivisions isZero not]) ifTrue: [aScale div: minorDivisions rounded]. self invert ifTrue: [aScale decrease] ifFalse: [aScale increase]. (base notNil and: [self scaleType == #log]) ifTrue: [aScale base: base rounded]
</methods> <methods> UI.ChartingScaleSpec <category>private-validation</category>
checkLogScaleForChart: aChart "Log scale must have a minimum value higher than zero and a base greater than 1." self base rounded > 1 ifFalse: [Dialog warn: (#GenKey5 << #BGOK >> 'The base for a logarithmic scale must be greater than or equal to 1.5.'). ^false]. self autoScale ifTrue: [^true]. self getMin > 0 ifFalse: [Dialog warn: (#GenKey4 << #BGOK >> 'The minimum value for a logarithmic scale must be greater then 0.'). ^false]. ^true
checkMinForChart: aChartType "Bar charts must have zero value between maximum and minimum." ((#(#BG_BarChartView #BG_ParatoChartView #BG_PictureChartView #BG_StackedBarChartView #BG_BandChartView #BG_LayerChartView ) includes: aChartType) and: [self autoScale not]) ifTrue: [(self getMin <= self getZero and: [self getZero <= self getMax]) ifFalse: [Dialog warn: (#GenKey6 << #BGOK >> 'The zero value for a scale for this type of chart must be between the minimum and maximum value.'). ^false]]. ^true
checkMinMax "Check min and max values for manual scales." min < max ifFalse: [Dialog warn: (#GenKey7 << #BGOK >> 'The minimum value for a scale must be smaller then the maximum value.'). ^false]. ^true
isDataValidForChart: aChartType "Answer true if the data is valid, false otherwise." (self minorDivisions notNil and: [self minorDivisions < 1]) ifTrue: [Dialog warn: (#GenKey8 << #BGOK >> 'The value for minor divisions has to be a positive integer.'). ^false]. self scaleType == #normal ifFalse: [(self checkLogScaleForChart: aChartType) ifFalse: [^false]]. self autoScale ifTrue: [^true]. (self checkMinMax and: [self checkMinForChart: aChartType]) ifFalse: [^false]. ^true
</methods> <methods> Examples.BG_EzChart <category>data2</category>
data2 ^#(#(100 20 'A') #(50 30 'B') #(-30 35 'C') #(34 30 'D') #(50 70 'E'))
</methods> <methods> Examples.BG_EzChart <category>data</category>
data ^#(1 2 3 4)
</methods> <methods> Examples.BG_EzChart class <category>markedAsSystemClass</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.BarChartOptionsSpec <category>accessing</category>
dataLocation dataLocation isNil ifTrue: [^#none]. ^dataLocation
dataLocation: aValue dataLocation := aValue
overlap ^overlap isNil ifTrue: [0] ifFalse: [overlap]
overlap: aValue overlap := aValue
picture ^picture
picture: aValue picture := aValue
showLink "Returns false if showLink is false or nil" ^showLink == true
showLink: aValue showLink := aValue
unit ^unit
unit: aValue unit := aValue
width ^width isNil ifTrue: [0.8] ifFalse: [width]
width: aValue width := aValue
</methods> <methods> UI.BarChartOptionsSpec <category>private</category>
simplified "Remove the default values." dataLocation == #none ifTrue: [dataLocation := nil]. showLink == false ifTrue: [showLink := nil]. ^super simplified
</methods> <methods> UI.BarChartOptionsSpec <category>private-interface building</category>
insertIntoView: aChartView withBuilder: builder "Insert optional parameters into a bar chart view" dataLocation isNil ifFalse: [dataLocation == #none ifTrue: [aChartView hideData]. dataLocation == #inside ifTrue: [aChartView dataInside]. dataLocation == #outside ifTrue: [aChartView dataOutside]]. overlap isNil ifFalse: [aChartView barOverlap: overlap]. width isNil ifFalse: [aChartView barWidth: width]. showLink isNil ifFalse: [showLink ifTrue: [aChartView showLink] ifFalse: [aChartView hideLink]]. unit isNil ifFalse: [aChartView unit: unit]. picture isNil ifFalse: [| image | image := builder aspectAt: picture. image isNil ifTrue: [image := aChartView class defaultPicture. builder isEditing ifFalse: [image := builder raiseErrorMessage: (#aspect1pNotFound << #BGOK >> 'aspect: <1p> not found!') with: picture]]. aChartView picture: image]
</methods> <methods> UI.BarChartOptionsSpec class <category>private-interface building</category>
addBindingsTo: env for: inst channel: aChannel | width overlap unit | super addBindingsTo: env for: inst channel: aChannel. width := self adapt: inst forAspect: #width channel: aChannel. overlap := self adapt: inst forAspect: #overlap channel: aChannel. unit := self adapt: inst forAspect: #unit channel: aChannel. unit compute: [:v| (v notNil and: [v < 0]) ifTrue: [unit value: nil]]. super addBindingsTo: env for: inst channel: aChannel. env at: #barWidth put: width. env at: #barOverlap put: overlap. env at: #showLink put: (self adapt: inst forAspect: #showLink channel: aChannel). env at: #dataLocation put: (self adapt: inst forAspect: #dataLocation channel: aChannel). env at: #unit put: (unit). env at: #picture put: (self adapt: inst forAspect: #picture channel: aChannel)
</methods> <methods> UI.BarChartOptionsSpec class <category>private</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.BG_ChartAxis <category>lines</category>
axisLine "Answer a Line to display axis line" ^axisLine
borderLine "Answer a Line to display border line" ^borderLine
hideAxisLine axisLine drawLine: false
hideBorderLine borderLine drawLine: false
hideSectionLine sectionLine drawLine: false
sectionLine "Answer a Line to display section line" ^sectionLine
sectionMarkAt "Answer a Symbol which represents the messege selector to find out the positions at which section are displayed" ^sectionMarkAt
sectionMarkAt: aSymbol "Make the argument, aSymbol, the messege selector to find out the positions at which section are displayed" sectionMarkAt := aSymbol
sectionMarks "Answer positions to display axis section" ^scale perform: sectionMarkAt
showAxisLine axisLine drawLine: true
showBorderLine borderLine drawLine: true
showSectionLine sectionLine drawLine: true
</methods> <methods> UI.BG_ChartAxis <category>tick marks</category>
hideTick "No tick marks" tickPosition := #hideTick. majorTick drawLine: false. minorTick drawLine: false
majorTick "Answer a Line to display major tick marks" ^majorTick
minorTick "Answer a Line to display minor tick marks" ^minorTick
tickCross "Set tick marks to display cross the frame" tickPosition := #tickCross. majorTick drawLine: true; component: (LineSegment from: 0@-2 to: 0@2). minorTick drawLine: true; component: (LineSegment from: 0@-1 to: 0@1).
tickInside "Set tick marks to display inside the frame" tickPosition := #tickInside. majorTick drawLine: true; component: (LineSegment from: 0@0 to: 0@4). minorTick drawLine: true; component: (LineSegment from: 0@0 to: 0@2).
tickOutside "Set tick marks to display outside the frame" tickPosition := #tickOutside. majorTick drawLine: true; component: (LineSegment from: 0@0 to: 0@-4). minorTick drawLine: true; component: (LineSegment from: 0@0 to: 0@-2).
tickPosition "Return tick position" ^tickPosition
</methods> <methods> UI.BG_ChartAxis <category>title/unit/labels</category>
autoLabels "Set a flag to find out axis labels automatically from the receiver's labelMarks." isAutoLabeled := true
isAutoLabeled "Answer true if the receiver sets axis labels automatically" ^isAutoLabeled
labels "Answer axis label items" ^labels item
labels: collectionOfString "Make the argument, collectionOfString, the axis labels" labels item: collectionOfString
labelsMarkAt "Answer a Symbol which represents the messege selector to find out the positions at which labels are displayed" ^labelsMarkAt
labelsMarkAt: aSymbol "Make the argument, aSymbol, the messege selector to find out the positions at which labels are displayed" labelsMarkAt := aSymbol
labelsMarks "Answer positions to display axis labels" ^scale perform: labelsMarkAt
labelsStyle "Answer a BG_LabelList represents axis labels attributes" ^labels
manualLabels "Set a flag to find out axis labels from instace variable 'labels'." isAutoLabeled := false
setLabelFormat: aSymbol | lbls | lbls := self labelsStyle. lbls notNil ifTrue: [lbls formatType: aSymbol]
title "Answer axis title item" ^title item
title: aString "Make the argument, aString, the axis title" title item: aString
titleStyle "Answer a BG_Banner represents axis title attributes" ^title
unit "Answer axis unit item" ^unit item
unit: aString "Make the argument, aString, the axis unit" unit item: aString
unitStyle "Answer a BG_Label represents axis unit attributes" ^unit
</methods> <methods> UI.BG_ChartAxis <category>initialize-release</category>
compose "Sets axis labels and scale automatically from the receiver's labelMarks" isAutoLabeled ifTrue: [| newLabels | newLabels := self labelsMarks. newLabels = self labels ifFalse: [self labels: newLabels]] ifFalse: [isAutoScaled ifTrue: [labelsMarkAt == #divisionMarks ifTrue: [self scale sourceMin: 0.5 max: labels item size + 0.5; zero: 0.5] ifFalse: [self scale sourceMin: 1 max: labels item size; zero: 1]. self scale step: 1; div: 1]]
dataAxis self autoScale. self autoLabels. self labelsMarkAt: #majorMarks. self tickInside.
fixedDataAxis self manualScale. self autoLabels. self labelsMarkAt: #majorMarks. self tickInside.
getLookPreferences ^axisLine lookPreferences
initialize scale := BG_ChartScale min: 0 max: 100 by: 20 from: 0. title := BG_Banner new. unit := BG_Label new. labels := BG_LabelList new. majorTick := BG_ChartElement new. minorTick := BG_ChartElement new. axisLine := BG_ChartElement new. borderLine := BG_ChartElement new. sectionLine := BG_ChartElement new. self sectionMarkAt: #majorMarks. self dataAxis.
itemAxis self autoScale. self manualLabels. self labelsMarkAt: #divisionMarks. self hideTick
manualAxis self manualScale. self manualLabels
newGraphicsDevice: aGraphicsDevice title newGraphicsDevice: aGraphicsDevice. unit newGraphicsDevice: aGraphicsDevice. labels newGraphicsDevice: aGraphicsDevice.
</methods> <methods> UI.BG_ChartAxis <category>scale</category>
autoScale isAutoScaled := true
isAutoScaled ^isAutoScaled
manualScale isAutoScaled := false
newScaleOfType: aSymbol | newScale | newScale := (aSymbol == #log ifTrue: [BG_ChartLogScale] ifFalse: [BG_ChartScale]) default. self scale: newScale
scale ^scale
scale: aScale "Make the argument, aScale, the axis scale" scale := aScale
</methods> <methods> UI.BG_ChartAxis class <category>instance creation</category>
new ^super new initialize
</methods> <methods> UI.ChartViewSpec <category>accessing</category>
chartType "Answer a default type if not set." chartType isNil ifTrue: [^#BG_BarChartView]. ^chartType
chartType: aValue chartType := aValue.
dataAxis "Answer yAxis." ^yAxis
dataLocation ^dataLocation
dataLocation: aValue dataLocation := aValue
dataSeries ^dataSeries
dataSeries: aValue dataSeries := aValue
itemAxis "If the chart type is XY. Answer xDataAxis, otherwise answer xAxis." ^self isXAxisData ifTrue: [xDataAxis] ifFalse: [xAxis]
legendPosition "For picture charts the default legend position is 6 (upper right corner)" ^legendPosition isNil ifTrue: [self chartType == #BG_PictureChartView ifTrue: [6] ifFalse: [0]] ifFalse: [legendPosition]
legendPosition: aValue legendPosition := aValue
options "Return the subspec describing that options that are compatible with the chart type." options isNil ifTrue: [^nil]. ^options at: self optionsType ifAbsent: [nil]
options: aValue options := aValue
orientation (orientation isNil or: [chartType == #BCxOK_PictureChartView]) ifTrue: [^#vertical]. ^orientation
orientation: aValue orientation := aValue
setChartType ^self chartType
setChartType: aValue "A chart type is about to change. Do the necessary transformations." | restrictions | chartType := aValue. restrictions := Set new. self isYAxisManual ifTrue: [restrictions add: #auto]. self setDataScaleRestrictions: restrictions
transposed: aValue orientation := aValue ifTrue: [#horizontal] ifFalse: [nil].
xAxis ^xAxis
xAxis: aValue xAxis := aValue
xDataAxis ^xDataAxis
xDataAxis: aValue xDataAxis := aValue
yAxis ^yAxis
yAxis: aValue yAxis := aValue
</methods> <methods> UI.ChartViewSpec <category>private</category>
defaultModel "The dispatchTo:with: method creates the real default model by asking the chart view. The one used here is only for the definer." ^List new asValue
dispatchTo: policy with: builder "Build the chart view. Construct chart views since charts do not change its look according to the policy. If the builder is editing, ask a chart view for a default model." | cv data ds | cv := (BindingReference pathString: self chartType) value new. ds := (dataSeries isNil or: [dataSeries series isNil]) ifTrue: [ChartDataSpec new: cv defaultNbrOfSeries] ifFalse: [dataSeries]. cv gridType == #normal ifTrue: [ "The scales have to be set before generating default models." self insertAxisIntoView: cv with: builder]. data := self modelInBuilder: builder. (builder isEditing and: [data size = 0]) ifTrue: ["Get better default model using view's knowledge." data := cv defaultModelFor: ds]. (data isKindOf: SelectionInList) ifTrue: [cv model: data listHolder] ifFalse: [cv model: data asValue]. "Insert descriptions of data series into a Chart View." ds insertIntoView: cv withBuilder: builder andPrefix: model. legendPosition notNil ifTrue: [cv legendAlignment: legendPosition]. self options notNil ifTrue: [self options insertIntoView: cv withBuilder: builder]. self orientation == #horizontal ifTrue: [cv transpose]. builder component: cv. builder wrapWith: (policy simpleWrapperFor: self). builder applyLayout: self layout. builder wrapWith: (policy simpleWidgetWrapperOn: builder spec: self state: cv widgetState)
fromLiteralArrayEncoding: anArray "Need to unpack subspecs. Options are internally stored as a dictionary containing options specs for all chart types, but in literal encoding only the relevant spec is preserved. This method restores a dictionary and puts the options spec in the proper slot. " super fromLiteralArrayEncoding: anArray. xAxis := xAxis decodeAsLiteralArray. yAxis := yAxis decodeAsLiteralArray. xDataAxis := xDataAxis decodeAsLiteralArray. dataSeries := dataSeries decodeAsLiteralArray. options notNil ifTrue: [| spec | spec := options decodeAsLiteralArray. options := nil. self setOptions: spec]
insertAxisIntoView: aView with: aBuilder "Depending on the chart type insert proper axis data." self dataAxis notNil ifTrue: [self dataAxis insertIntoAxis: aView grid y with: aBuilder]. self itemAxis notNil ifTrue: [self itemAxis insertIntoAxis: aView grid x with: aBuilder].
literalArrayEncoding "Answer a literal array representing this specification. Make sure that only options relevant to the currently selected chart type are stored." | savedOptions res | self simplify. savedOptions := options. options := self options. res := super literalArrayEncoding. options := savedOptions. ^res
setDataScaleRestrictions: aSet "Note that this method creates a data set scale if neccessary." | scale | scale := self yScaleSpec. scale restrictions: aSet asArray.
setOptions: aSpec "This method is different from the 'options:' method since it assumes the parameter is an instance of SubSpec." options isNil ifTrue: [options := IdentityDictionary new]. options at: self optionsType put: aSpec
simplify "Check if we can remove some sub specs. A lot of unimportant information may be created as the user looks around and switches the slices in the properties tool. " xAxis notNil ifTrue: [xAxis := xAxis simplified]. xDataAxis notNil ifTrue: [xDataAxis := xDataAxis simplified]. yAxis notNil ifTrue: [yAxis := yAxis simplified]. dataSeries notNil ifTrue: [dataSeries := dataSeries simplified]. self options notNil ifTrue: [self setOptions: self options simplified].
</methods> <methods> UI.ChartViewSpec <category>private-accessing</category>
chartInfo "Answer the array from the ChartTypes. This is the primary method of obtaining chart characteristics." ^ChartTypes at: self chartType.
isXAxisData "Answer true if a chart is given a type. The item axis should be data axis. Currently this is true only for XY charts. " ^(self chartInfo at: 1) == #xdata
isYAxisManual "Answer true if this chart's axis is restricted to manual." ^(self chartInfo at: 2) == #yrestricted
optionsSpecClass "Answer a class appropriate for chart options." | type | type := self optionsType. type == #bar ifTrue: [^BarChartOptionsSpec]. type == #line ifTrue: [^LineChartOptionsSpec]. ^PieChartOptionsSpec
optionsType "Answer a type of options dialog appropriate for a given chart type. Chart option types fall into the following three categories: bar, line, pie. See the ChartViewSpec class >> initalize message" ^(self chartInfo at: 4)
</methods> <methods> UI.ChartViewSpec <category>copying</category>
postCopy "Copy all sub-specs." xAxis := xAxis copy. xDataAxis := xDataAxis copy. yAxis := yAxis copy. dataSeries := dataSeries copy. options := options copy.
</methods> <methods> UI.ChartViewSpec <category>private-interface building</category>
dataSeriesSpec "Answer a sub-spec responsible for the definiton of a data series. This method is used by the properties tool to get the proper slice." | series | series := self dataSeries. series isNil ifTrue: [series := ChartDataSpec new. self dataSeries: series]. ^series
optionsSpec "Answer a sub-spec responsible for the char options. This method is used by the properties tool to get the proper slice." | spec | spec := self options. spec isNil ifTrue: [spec := self optionsSpecClass new. self setOptions: spec]. ^spec
subSpecFor: aSlice "Given a slice, answer an appropriate sub-spec. Note that this action may create the sub-specs. If the requested slice does not exist, answer self." aSlice == #dataSeries ifTrue: [^self dataSeriesSpec]. aSlice == #options ifTrue: [^self optionsSpec]. aSlice == #xAxis ifTrue: [^self xAxisSpec]. aSlice == #yAxis ifTrue: [^self yAxisSpec]. aSlice == #xScale ifTrue: [^self xScaleSpec]. aSlice == #yScale ifTrue: [^self yScaleSpec]. ^self.
xAxisSpec "Answer a sub-spec responsible for the item axis. Note that for charts other than XY, the item scale is restricted." self itemAxis isNil ifTrue: [self isXAxisData ifTrue: [self xDataAxis: ChartingValueAxisSpec new] ifFalse: [self xAxis: ChartingAxisSpec new]]. ^self itemAxis
xScaleSpec "Answer a sub-spec responsible for the item scale" | scaleSpec | scaleSpec := self xAxisSpec scale. scaleSpec isNil ifTrue: [scaleSpec := ChartingScaleSpec new. self isXAxisData ifFalse: [scaleSpec restrictions: #(#auto #zero #div #log )]. self xAxisSpec scale: scaleSpec]. ^scaleSpec
yAxisSpec "Answer a sub-spec responsible for the data axis" self dataAxis isNil ifTrue: [self yAxis: ChartingValueAxisSpec new]. ^self dataAxis
yScaleSpec "Answer a sub-spec responsible for the data scale" | scaleSpec | scaleSpec := self yAxisSpec scale. scaleSpec isNil ifTrue: [scaleSpec := ChartingScaleSpec new. scaleSpec invert: true. self isYAxisManual ifTrue: [scaleSpec addRestrictions: #(auto)]. self yAxisSpec scale: scaleSpec]. ^scaleSpec
</methods> <methods> UI.ChartViewSpec <category>private-validation</category>
isDataValid "Test if the data is valid, and if it is answer true. The properties tool uses this method to check integrity of the spec before building a view." dataSeries notNil ifTrue: [(dataSeries isDataValidForChart: self chartType) ifFalse: [^false]]. yAxis notNil ifTrue: [ yAxis scale notNil ifTrue: [(yAxis scale isDataValidForChart: self chartType) ifFalse: [^false]]]. ^true
</methods> <methods> UI.ChartViewSpec class <category>private-interface building</category>
addBindingsTo: env for: inst channel: aChannel | chartType | super addBindingsTo: env for: inst channel: aChannel. env at: #position put: (self adapt: inst forAspect: #legendPosition channel: aChannel). chartType := self adapt: inst forAspect: #setChartType channel: aChannel. env at: #labels put: (TypeConverter onSymbolValue: (self adapt: inst forAspect: #labels channel: aChannel)). env at: #orientation put: (self adapt: inst forAspect: #orientation channel: aChannel). env at: #setChartType put: chartType. env at: #chartTypeMenu put: self chartTypeMenu asValue
componentName ^(#Chart << #BGOK >> 'Chart') asString
</methods> <methods> UI.ChartViewSpec class <category>class-initialization</category>
initialize "Initialize the class." "Create a dictionary, use chart types as keys and put arrays describing properties of charts as values. Each array has the following structure: 1st element describes the type of data axis appropriate for the given chart type. Choice are xitem meaning that x axis is item axis so it can only be automatically labeled. The only exception is XY chart which has the x axis as full blown data axis. 2nd element of the array describes the y axis. Restricted axis are used for Pareto and band charts. 3th element describes if the chart uses fill patterns or line widths as options. 4th element says what kind of options dialog should be used. Also: Install ChartViewSpec into the UIPalette activeSpecsList" "self initalize" ChartTypes := IdentityDictionary new. ChartTypes at: #BG_BarChartView put: #(#xitem #ynormal #regions #bar). ChartTypes at: #BG_ParatoChartView put: #(#xitem #yrestricted #regions #bar). ChartTypes at: #BG_PictureChartView put: #(#xitem #ynormal #regions #bar). ChartTypes at: #BG_StackedBarChartView put: #(#xitem #ynormal #regions #bar). ChartTypes at: #BG_BandChartView put: #(#xitem #yrestricted #regions #bar). ChartTypes at: #BG_LayerChartView put: #(#xitem #ynormal #regions #bar). ChartTypes at: #BG_LineChartView put: #(#xitem #ynormal #lines #line). ChartTypes at: #BG_StackedLineChartView put: #(#xitem #ynormal #lines #line). ChartTypes at: #BG_StepChartView put: #(#xitem #ynormal #lines #line). ChartTypes at: #BG_XYChartView put: #(#xdata #ynormal #lines #line). ChartTypes at: #BG_PieChartView put: #(#xitem #yrestricted #regions #pie). #{UIPalette} ifDefinedDo: [:uip | (uip activeSpecsList includes: #ChartViewSpec) ifFalse: [uip activeSpecsList add: #ChartViewSpec]]
</methods> <methods> UI.ChartViewSpec class <category>private</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.ChartViewSpec class <category>resources</category>
iconForWidgetTree ^ToolbarIconLibrary visualFor: #chartWidget
</methods> <methods> UI.ChartViewSpec class <category>property slices</category>
basicSlice ^#(5 #(#(#{Kernel.UserMessage} #key: #Basics #defaultString: 'Basics' #catalogID: #BGOK) #defaultDialogSpec))
dataAxisSlice ^#(28 #(#(#{Kernel.UserMessage} #key: #DataAxis #defaultString: 'Data - Axis' #catalogID: #BGOK) #defaultDialogSpec nil #yAxis))
dataScaleSlice ^#(31 #(#(#{Kernel.UserMessage} #key: #DataScale #defaultString: 'Data - Scale' #catalogID: #BGOK) #defaultPropertySpec #ChartScaleSpecModel #yScale))
dataSeriesSlice ^#(13 #(#(#{Kernel.UserMessage} #key: #DataSeries #defaultString: 'Data Series' #catalogID: #BGOK) #defaultPropertySpec #ChartDataSpecModel #dataSeries))
detailsSlice "Empty means NO PAGE!" ^#(1 #())
itemAxisSlice ^#(22 #(#(#{Kernel.UserMessage} #key: #ItemAxis #defaultString: 'Item - Axis' #catalogID: #BGOK) #defaultDialogSpec nil #xAxis))
itemScaleSlice ^#(25 #(#(#{Kernel.UserMessage} #key: #ItemScale #defaultString: 'Item - Scale' #catalogID: #BGOK) #defaultPropertySpec #ChartScaleSpecModel #xScale))
legendSlice ^#(19 #(#(#{Kernel.UserMessage} #key: #Legend #defaultString: 'Legend' #catalogID: #BGOK) #legendDialogSpec))
notificationSlice "Empty array means no page!" ^#(1 #())
optionsSlice ^#(10 #(#(#{Kernel.UserMessage} #key: #Options #defaultString: 'Options' #catalogID: #BGOK) #defaultDialogSpec nil #options))
validationSlice "Empty array means no page!" ^#(1 #())
</methods> <methods> UI.ChartViewSpec class <category>private-implementation classes</category>
writeImplementationClassesToFilename: aFilename "Write the private implementation classes as binary into the given filename. They can be reloaded later with the readImplementationClassesFromFilename: message." "ChartView writeImplementationClassesToFilename: 'bgraph.boss' asFilename" "| bossFile | bossFile := BinaryObjectStorage onNew: aFilename writeStream. bossFile sourceMode: #discard. [ aBossFile nextPutClasses: ] ensure: [bossFile close]"
</methods> <methods> UI.BG_LayerChartView <category>private</category>
legendSize ^self data rowSize
</methods> <methods> UI.BG_LayerChartView <category>displaying</category>
displayPlotOn: aGraphicsContext | value points collection gc | value := self data. points := BG_TableAdaptor columns: value columnSize rows: (value rowSize+1). 1 to: value columnSize do: [:x | | n v | n := sortedIndex at: x. v := grid y scale zero. points at: x @1 put: x@grid y scale zero. 1 to: value rowSize do: [:y | points at: x @(y+1) put: x@(v := v + (value at: n@y))]]. collection := grid applyToValues: points. 1 to: value rowSize do: [:y | | vertices | gc := self setClientDataFor: aGraphicsContext index: y foreground: false. vertices := (collection rowAt: y) , (collection rowAt: y+1) asArray reverse. (BG_ChartElement on: (Polyline vertices: vertices)) drawLine: false; displayOn: gc]. 1 to: value rowSize do: [:y | (Polyline vertices: (collection rowAt: y+1)) asStroker displayOn: aGraphicsContext]
</methods> <methods> UI.ChartDataSetSpec <category>accessing</category>
aspect ^aspect
aspect: aValue aspect := aValue
isComputed ^isComputed == true
isComputed: aValue isComputed := aValue
isData ^isData ~= false
isData: aValue isData := aValue
isLabel ^self isData not
isLabel: aBoolean self isData: aBoolean not
look ^look
look: aValue look := aValue
name ^name
name: aValue name := aValue
</methods> <methods> UI.ChartDataSetSpec <category>copying</category>
postCopy look := look copy
</methods> <methods> UI.ChartDataSetSpec <category>private-interface building</category>
fromLiteralArrayEncoding: anArray super fromLiteralArrayEncoding: anArray. "At this moment look is encoded as a literal array and has to be unpacked." look := look decodeAsLiteralArray
insertIntoDescriptor: dataDescriptor withBuilder: builder andPrefix: aSymbol "Transfer the knowledge from spec into the data descriptor. aSymbol describes a main data model for the chart view. Note that while a builder is editing data, access methods are suppressed." (builder isEditing not and: [aspect notNil]) ifTrue: [ | model fullAspect| fullAspect := self isComputed ifTrue: [aspect] ifFalse: [aSymbol , ' ', aspect asSymbol]. model := builder aspectAt: fullAspect. model isNil ifTrue: [model := builder raiseErrorMessage: (#aspect1pNotFound << #BGOK >> 'aspect: <1p> not found!') with: fullAspect]. dataDescriptor adaptor: model]. self isData ifFalse: [dataDescriptor holdLabel]. name isNil ifFalse: [dataDescriptor name: name]. look isNil ifFalse: [look insertIntoDescriptor: dataDescriptor]
simplified "Check if look spec can be simplified, but never answer nil." look isNil ifFalse: [look := look simplified]
</methods> <methods> Examples.BG_SalesItem <category>salesHP:</category>
salesHP: aValue salesHP := aValue
</methods> <methods> Examples.BG_SalesItem <category>salesSun:</category>
salesSun: aValue salesSun := aValue
</methods> <methods> Examples.BG_SalesItem <category>salesRS:</category>
salesRS: aValue salesRS := aValue
</methods> <methods> Examples.BG_SalesItem <category>salesWin:</category>
salesWin: aValue salesWin := aValue
</methods> <methods> Examples.BG_SalesItem <category>salesMac</category>
salesMac ^salesMac
</methods> <methods> Examples.BG_SalesItem <category>month</category>
month ^month
</methods> <methods> Examples.BG_SalesItem <category>total</category>
total ^self salesWin + self salesSun + self salesMac + self salesHP
</methods> <methods> Examples.BG_SalesItem <category>salesHP</category>
salesHP ^salesHP
</methods> <methods> Examples.BG_SalesItem <category>month:</category>
month: aValue month := aValue
</methods> <methods> Examples.BG_SalesItem <category>salesSun</category>
salesSun ^salesSun
</methods> <methods> Examples.BG_SalesItem <category>salesRS</category>
salesRS ^salesRS
</methods> <methods> Examples.BG_SalesItem <category>initialize</category>
initialize salesHP := salesMac := salesRS := salesSun := salesWin := 0.
</methods> <methods> Examples.BG_SalesItem <category>salesWin</category>
salesWin ^salesWin
</methods> <methods> Examples.BG_SalesItem <category>salesMac:</category>
salesMac: aValue salesMac := aValue
</methods> <methods> Examples.BG_SalesItem class <category>new</category>
new ^super new initialize
</methods> <methods> UI.BG_ChartLogScale <category>accessing</category>
base ^base
base: aNumber base := aNumber. zero := base raisedTo: (sourceMin log: base) floor.
baseExp self base: 1 exp
sourceMin: min max: max super sourceMin: min max: max. zero := (base raisedTo: (sourceMin log: base) floor) asFloat.
step: positiveNumber step := ((positiveNumber abs max: 1) min: 10) asFloat.
zero: aNumber
</methods> <methods> UI.BG_ChartLogScale <category>private</category>
getScaleMin: min max: max min <= 0 ifTrue: [^Array with: 1 with: (base raisedTo: (max log: base) ceiling) with: 10] ifFalse: [^Array with: (base raisedTo: (min log: base) floor) with: (base raisedTo: (max log: base) ceiling) with: 10]
logSourceLength ^(sourceMax log: base) - (sourceMin log: base)
setMin: minValue max: maxValue by: stepValue from: zeroValue div: divisionValue "Initialize the instance variables." base := 10. super setMin: minValue max: maxValue by: stepValue from: zeroValue div: divisionValue
</methods> <methods> UI.BG_ChartLogScale <category>testing</category>
scaleType "I'm a Log Scale" ^#log
</methods> <methods> UI.BG_ChartLogScale <category>applying transform</category>
applyInverseTo: aNumber | rate | rate := (aNumber - destMin) / self destLength. ^self inverseFilter: (base raisedTo: (increase ifTrue: [rate] ifFalse: [1 - rate]) * self logSourceLength + (sourceMin log: base))
applyTo: aNumber | rate | aNumber = 0 ifTrue: [^0]. rate := ((self filter: aNumber) log: base) - (sourceMin log: base) / self logSourceLength. ^(increase ifTrue: [rate] ifFalse: [1 - rate]) * self destLength + destMin
</methods> <methods> UI.BG_ChartLogScale <category>mark access</category>
divisionMarks | marks start stop by times in | marks := OrderedCollection new. times := (sourceMax log: base) ceiling - (sourceMin log: base) floor. start := self zero. stop := start * 10. by := step * start. 1 to: times do: [:i | in := false. (by/2) to: stop by: by do: [:n | n > sourceMax ifTrue: [^marks]. (n > start and: [n >= sourceMin]) ifTrue: [in := true]. in ifTrue: [marks add: n asFloat]]. start := start * 10. stop := stop * 10. by := by * 10]. ^marks
majorMarks | marks start stop by times in | marks := OrderedCollection new. times := (sourceMax log: base) ceiling - (sourceMin log: base) floor. start := self zero. stop := start * 10. by := step * start. start >= sourceMin ifTrue: [marks add: start asFloat]. 1 to: times do: [:i | in := false. 0 to: stop by: by do: [:n | n > sourceMax ifTrue: [^marks]. (n > start and: [n >= sourceMin]) ifTrue: [in := true]. in ifTrue: [marks add: n asFloat]]. start := start * 10. stop := stop * 10. by := by * 10]. ^marks
minorMarks | marks start stop by times in | marks := OrderedCollection new. times := (sourceMax log: base) ceiling - (sourceMin log: base) floor. start := self zero. stop := start * 10. by := step / div * start. start >= sourceMin ifTrue: [marks add: start asFloat]. 1 to: times do: [:i | in := false. 0 to: stop by: by do: [:n | n > sourceMax ifTrue: [^marks]. (n > start and: [n >= sourceMin]) ifTrue: [in := true]. in ifTrue: [marks add: n asFloat]]. start := start * 10. stop := stop * 10. by := by * 10]. ^marks
</methods> <methods> UI.BG_ChartLogScale class <category>instance creation</category>
default "Answer a new instance of BG_ChartScale" ^self min: 0.1 max: 100 by: 5
</methods> <methods> Examples.BG_StockTool <category>newSymbol</category>
newSymbol "New symbol has been selected by the user. Set new value of data holder and change the name of the data set." chartView descriptors first name: stocks selection. data value: (quotes select: [:quote| quote symbol = stocks selection])
</methods> <methods> Examples.BG_StockTool <category>initialize</category>
initialize super initialize. stocks := SelectionInList new. quotes := List new. stocks selectionIndexHolder onChangeSend: #newSymbol to: self. data := #() asValue
</methods> <methods> Examples.BG_StockTool <category>loadQuotes</category>
loadQuotes "Load the sample quotes data." self readQuotesFrom: self class sampleQuoteData readStream
</methods> <methods> Examples.BG_StockTool <category>stockNames</category>
stockNames ^stocks
</methods> <methods> Examples.BG_StockTool <category>readQuotesFrom:</category>
readQuotesFrom: aStream "Read data from stream." | stocksInFile | stocksInFile := Set new. quotes removeAllSuchThat: [:o| true]. [ [aStream skipSeparators. aStream atEnd] whileFalse: [| quote | quote := BG_StockQuote readFrom: aStream. stocksInFile add: quote symbol. quotes add: quote]] ensure: [aStream close]. stocks list: stocksInFile asSortedCollection asList
</methods> <methods> Examples.BG_StockTool <category>postBuildWith:</category>
postBuildWith: aBuilder "I need to access data set descriptors in order to change the name in the legend." chartView := (aBuilder componentAt: #stocks) widget
</methods> <methods> Examples.BG_StockTool <category>labels</category>
labels "We have to limit a number of labels displayed to prevent overlaping. Every seventh label is displayed as a date, the rest use empty strings." ^(PluggableAdaptor new) getBlock: [:m | (self data value indexOf: m) \\ 7 = 1 ifTrue: [m date printFormat: #(2 1 3 $/ 1 2 )] ifFalse: ['']] putBlock: [:b :v | ] updateBlock: [:b :a :p | false]; yourself
</methods> <methods> Examples.BG_StockTool <category>data</category>
data ^data
</methods> <methods> Examples.BG_StockTool class <category>sampleQuoteData</category>
sampleQuoteData "Answer a string with sample quote data." ^'Sep 9, 1993 AAPL 26.000 27.000 26.000 Sep 9, 1993 BORL 15.000 15.750 14.750 Sep 9, 1993 FRAM 7.875 8.000 7.500 Sep 9, 1993 SNPS 49.750 50.000 46.750 Sep 9, 1993 SUNW 27.500 27.625 26.750 Sep 10, 1993 AAPL 26.000 26.250 25.375 Sep 10, 1993 BORL 14.875 15.250 14.250 Sep 10, 1993 FRAM 7.750 7.875 7.750 Sep 10, 1993 SNPS 50.000 50.000 49.500 Sep 10, 1993 SUNW 28.000 28.125 27.500 Sep 13, 1993 AAPL 25.250 26.500 24.750 Sep 13, 1993 BORL 14.875 15.500 14.500 Sep 13, 1993 FRAM 8.125 8.125 7.750 Sep 13, 1993 SNPS 48.375 50.000 48.250 Sep 13, 1993 SUNW 27.500 28.125 27.500 Sep 14, 1993 AAPL 24.250 25.000 24.000 Sep 14, 1993 BORL 15.000 15.250 14.500 Sep 14, 1993 FRAM 7.625 8.125 7.625 Sep 14, 1993 SNPS 46.750 48.000 46.250 Sep 14, 1993 SUNW 26.875 27.500 26.250 Sep 15, 1993 AAPL 24.000 25.000 23.500 Sep 15, 1993 BORL 13.875 15.000 13.750 Sep 15, 1993 FRAM 7.750 8.125 7.625 Sep 15, 1993 SNPS 46.875 46.875 46.750 Sep 15, 1993 SUNW 26.750 26.875 26.750 Sep 16, 1993 AAPL 24.750 25.000 24.250 Sep 16, 1993 BORL 14.000 14.250 13.000 Sep 16, 1993 FRAM 7.625 7.750 7.500 Sep 16, 1993 SNPS 47.000 47.000 45.750 Sep 16, 1993 SUNW 25.000 25.500 24.750 Sep 17, 1993 AAPL 25.250 25.500 24.250 Sep 17, 1993 BORL 13.750 14.000 13.000 Sep 17, 1993 FRAM 7.500 7.625 7.500 Sep 17, 1993 SNPS 45.500 46.500 44.750 Sep 17, 1993 SUNW 26.000 26.250 24.750 Sep 20, 1993 AAPL 24.875 25.500 24.750 Sep 20, 1993 BORL 14.000 14.250 13.500 Sep 20, 1993 FRAM 7.875 7.875 7.625 Sep 20, 1993 SNPS 46.250 46.250 44.750 Sep 20, 1993 SUNW 26.125 27.125 26.000 Sep 21, 1993 AAPL 24.500 25.250 23.875 Sep 21, 1993 BORL 13.250 14.000 12.750 Sep 21, 1993 FRAM 7.625 8.000 7.625 Sep 21, 1993 SNPS 45.250 46.250 45.000 Sep 21, 1993 SUNW 26.375 26.625 25.875 Sep 22, 1993 AAPL 25.500 25.500 24.250 Sep 22, 1993 BORL 13.750 13.750 13.000 Sep 22, 1993 FRAM 7.750 7.875 7.375 Sep 22, 1993 SNPS 46.500 46.500 45.500 Sep 22, 1993 SUNW 26.500 27.000 26.375 Sep 23, 1993 AAPL 24.750 25.500 24.500 Sep 23, 1993 BORL 15.000 15.000 13.500 Sep 23, 1993 FRAM 7.875 7.875 7.750 Sep 23, 1993 SNPS 48.750 49.250 46.500 Sep 23, 1993 SUNW 27.000 27.125 26.500 Sep 24, 1993 AAPL 25.250 25.250 24.500 Sep 24, 1993 BORL 14.250 15.000 14.250 Sep 24, 1993 FRAM 7.875 7.875 7.750 Sep 24, 1993 SNPS 48.250 49.750 48.250 Sep 24, 1993 SUNW 26.375 27.000 26.125 Sep 27, 1993 AAPL 24.750 25.250 24.250 Sep 27, 1993 FRAM 7.750 7.875 7.750 Sep 27, 1993 SNPS 47.750 48.750 47.500 Sep 27, 1993 SUNW 26.000 26.500 26.000 Sep 28, 1993 AAPL 24.750 25.000 24.250 Sep 28, 1993 BORL 14.750 15.000 14.500 Sep 28, 1993 FRAM 7.875 7.875 7.750 Sep 28, 1993 SNPS 47.750 48.250 47.750 Sep 28, 1993 SUNW 25.875 26.250 25.625 Sep 29, 1993 AAPL 23.875 24.875 23.750 Sep 29, 1993 BORL 15.125 16.000 14.500 Sep 29, 1993 FRAM 7.750 7.875 7.750 Sep 29, 1993 SNPS 47.250 47.750 47.250 Sep 29, 1993 SUNW 25.250 25.875 24.875 Sep 30, 1993 AAPL 23.375 24.000 23.000 Sep 30, 1993 BORL 15.125 15.500 15.000 Sep 30, 1993 FRAM 7.750 7.875 7.625 Sep 30, 1993 SNPS 47.500 47.500 46.750 Sep 30, 1993 SUNW 24.000 25.500 24.000 Oct 1, 1993 AAPL 22.750 23.750 22.500 Oct 1, 1993 BORL 15.000 15.500 14.875 Oct 1, 1993 FRAM 7.875 7.875 7.500 Oct 1, 1993 SNPS 47.000 47.500 47.000 Oct 1, 1993 SUNW 22.125 23.875 21.625 Oct 4, 1993 AAPL 22.750 23.000 22.000 Oct 4, 1993 BORL 15.125 15.250 15.000 Oct 4, 1993 FRAM 7.500 7.500 7.500 Oct 4, 1993 SNPS 47.125 47.250 47.000 Oct 4, 1993 SUNW 23.125 23.875 22.250 Oct 6, 1993 AAPL 23.625 24.000 23.375 Oct 6, 1993 BORL 15.875 15.875 15.500 Oct 6, 1993 FRAM 7.375 7.500 7.250 Oct 6, 1993 SNPS 45.625 45.750 43.500 Oct 6, 1993 SUNW 22.250 22.875 22.125 Oct 7, 1993 AAPL 23.000 23.750 22.750 Oct 7, 1993 BORL 15.875 15.875 15.750 Oct 7, 1993 FRAM 7.625 7.625 7.375 Oct 7, 1993 SNPS 45.250 46.250 45.000 Oct 7, 1993 SUNW 21.750 22.250 21.750 Oct 8, 1993 AAPL 22.625 23.250 22.250 Oct 8, 1993 BORL 16.125 16.500 16.000 Oct 8, 1993 FRAM 7.625 7.625 7.500 Oct 8, 1993 SNPS 45.000 46.000 45.000 Oct 8, 1993 SUNW 21.250 21.750 21.125 Oct 11, 1993 AAPL 23.750 24.000 22.750 Oct 11, 1993 BORL 16.000 16.500 16.000 Oct 11, 1993 FRAM 7.625 7.625 7.500 Oct 11, 1993 SNPS 45.250 45.750 44.750 Oct 11, 1993 SUNW 22.000 22.625 21.125 Oct 12, 1993 AAPL 24.000 25.000 23.750 Oct 12, 1993 BORL 16.000 16.375 15.875 Oct 12, 1993 FRAM 7.500 7.625 7.500 Oct 12, 1993 SNPS 48.500 48.750 45.750 Oct 12, 1993 SUNW 22.500 22.750 22.000 Oct 13, 1993 AAPL 24.000 24.250 23.500 Oct 13, 1993 BORL 15.500 15.875 15.375 Oct 13, 1993 FRAM 8.500 8.500 7.625 Oct 13, 1993 SNPS 49.000 49.250 48.250 Oct 13, 1993 SUNW 21.625 22.375 21.125 Oct 14, 1993 AAPL 23.750 24.500 23.500 Oct 14, 1993 BORL 15.500 15.750 15.500 Oct 14, 1993 FRAM 8.625 8.750 8.375 Oct 14, 1993 SNPS 50.750 51.000 49.000 Oct 14, 1993 SUNW 23.000 23.250 21.250 Oct 15, 1993 AAPL 28.250 28.500 24.500 Oct 15, 1993 BORL 15.375 15.625 15.125 Oct 15, 1993 FRAM 8.625 8.750 8.625 Oct 15, 1993 SNPS 51.750 52.000 50.500 Oct 15, 1993 SUNW 23.375 23.625 22.250 Oct 18, 1993 AAPL 28.375 28.750 27.750 Oct 18, 1993 BORL 15.500 15.500 15.000 Oct 18, 1993 FRAM 8.875 9.125 8.625 Oct 18, 1993 SNPS 51.000 51.250 50.500 Oct 18, 1993 SUNW 24.125 24.500 23.375 Oct 19, 1993 AAPL 27.750 28.500 27.250 Oct 19, 1993 BORL 14.750 15.500 14.750 Oct 19, 1993 FRAM 9.000 9.625 8.875 Oct 19, 1993 SNPS 48.750 50.750 48.250 Oct 19, 1993 SUNW 24.375 24.750 24.125 Oct 20, 1993 AAPL 27.750 28.250 27.250 Oct 20, 1993 BORL 15.750 15.875 14.875 Oct 20, 1993 FRAM 8.750 9.250 8.750 Oct 20, 1993 SNPS 47.000 49.000 47.000 Oct 20, 1993 SUNW 24.250 24.875 24.000 Oct 21, 1993 AAPL 30.250 31.250 27.250 Oct 21, 1993 BORL 15.625 15.875 15.375 Oct 21, 1993 FRAM 9.125 9.125 8.750 Oct 21, 1993 SNPS 47.500 48.000 46.750 Oct 21, 1993 SUNW 24.750 25.125 24.125 Oct 22, 1993 AAPL 30.500 31.500 29.750 Oct 22, 1993 BORL 16.000 16.000 14.875 Oct 22, 1993 FRAM 8.875 9.000 8.750 Oct 22, 1993 SNPS 49.250 51.250 47.500 Oct 22, 1993 SUNW 25.125 25.375 24.625 Oct 25, 1993 AAPL 29.750 30.500 29.625 Oct 25, 1993 BORL 16.625 16.875 15.875 Oct 25, 1993 FRAM 8.375 8.875 8.375 Oct 25, 1993 SNPS 48.500 49.500 48.000 Oct 25, 1993 SUNW 24.875 25.625 24.500 Oct 26, 1993 AAPL 29.750 30.000 29.000 Oct 26, 1993 BORL 16.625 16.875 16.250 Oct 26, 1993 FRAM 9.500 9.500 8.500 Oct 26, 1993 SNPS 48.250 48.250 47.000 Oct 26, 1993 SUNW 24.625 25.000 24.500 Oct 27, 1993 AAPL 31.750 32.250 29.750 Oct 27, 1993 AAPL 31.750 32.250 29.750 Oct 27, 1993 BORL 17.625 17.625 16.625 Oct 27, 1993 FRAM 10.375 10.375 9.500 Oct 27, 1993 SNPS 50.000 50.000 47.750 Oct 27, 1993 SUNW 24.875 25.000 24.500 Oct 28, 1993 AAPL 31.000 32.250 31.000 Oct 28, 1993 BORL 16.750 17.625 16.750 Oct 28, 1993 FRAM 10.250 11.000 10.125 Oct 28, 1993 SNPS 51.750 52.750 49.750 Oct 28, 1993 SUNW 24.875 25.125 24.625 Oct 29, 1993 AAPL 30.750 31.750 30.500 Oct 29, 1993 BORL 17.375 17.500 16.750 Oct 29, 1993 FRAM 9.625 10.375 9.625 Oct 29, 1993 SNPS 51.750 52.000 50.750 Oct 29, 1993 SUNW 25.625 25.750 24.875 Nov 1, 1993 AAPL 30.875 31.000 30.500 Nov 1, 1993 BORL 17.250 17.500 16.750 Nov 1, 1993 FRAM 9.875 10.375 9.625 Nov 1, 1993 SNPS 52.000 52.750 51.750 Nov 1, 1993 SUNW 25.500 25.750 24.875 Nov 1, 1993 AAPL 31.500 31.500 30.250 Nov 1, 1993 BORL 17.125 17.500 17.000 Nov 1, 1993 FRAM 10.125 10.250 9.625 Nov 1, 1993 SNPS 51.125 52.750 50.750 Nov 1, 1993 SUNW 25.875 26.250 25.500 Nov 3, 1993 AAPL 32.250 33.000 32.250 Nov 3, 1993 BORL 17.125 17.250 17.000 Nov 3, 1993 FRAM 10.750 10.750 10.000 Nov 3, 1993 SNPS 49.500 49.500 49.500 Nov 3, 1993 SUNW 25.000 25.625 25.000 Nov 5, 1993 AAPL 31.750 32.000 31.250 Nov 5, 1993 BORL 16.500 16.625 16.500 Nov 5, 1993 FRAM 10.000 10.750 10.000 Nov 5, 1993 SNPS 47.250 48.000 46.750 Nov 5, 1993 SUNW 24.125 24.375 24.125 Nov 5, 1993 AAPL 31.875 32.250 30.750 Nov 5, 1993 BORL 17.125 17.250 16.250 Nov 5, 1993 FRAM 10.250 10.250 10.000 Nov 5, 1993 SNPS 48.750 49.000 46.500 Nov 5, 1993 SUNW 24.875 25.125 23.750 Nov 8, 1993 AAPL 31.375 32.250 31.000 Nov 8, 1993 BORL 17.625 17.750 17.375 Nov 8, 1993 FRAM 9.750 10.250 9.750 Nov 8, 1993 SNPS 48.875 49.000 46.500 Nov 8, 1993 SUNW 25.000 25.125 24.875 Nov 8, 1993 AAPL 30.750 32.125 30.500 Nov 8, 1993 BORL 17.500 17.875 17.250 Nov 8, 1993 FRAM 10.000 10.125 9.750 Nov 8, 1993 SNPS 49.500 49.500 48.500 Nov 8, 1993 SUNW 24.750 25.125 24.500 Nov 10, 1993 AAPL 30.250 30.500 30.250 Nov 10, 1993 BORL 16.875 17.125 16.875 Nov 10, 1993 FRAM 10.000 10.250 9.875 Nov 10, 1993 SNPS 50.000 50.750 49.500 Nov 10, 1993 SUNW 24.875 25.000 24.875 '
</methods> <methods> Examples.BG_StockQuote <category>date</category>
date ^date
</methods> <methods> Examples.BG_StockQuote <category>price:</category>
price: aValue price := aValue
</methods> <methods> Examples.BG_StockQuote <category>date:</category>
date: aValue date := aValue
</methods> <methods> Examples.BG_StockQuote <category>symbol</category>
symbol ^symbol
</methods> <methods> Examples.BG_StockQuote <category>price</category>
price ^price
</methods> <methods> Examples.BG_StockQuote <category>symbol:</category>
symbol: aValue symbol := aValue
</methods> <methods> Examples.BG_StockQuote class <category>readFrom:</category>
readFrom: aStream "Create an instance from text. The format of a quote is as follows: 'Sep 10, 1993 ASPX 10.750 \n'" | baby | baby := self new. baby date: (Date readFrom: aStream). aStream skipSeparators. baby symbol: (aStream upTo: $ ). aStream skipSeparators. baby price: (Float readFrom: aStream). aStream through: Character cr. ^baby
</methods> <methods> Examples.BG_Sales <category>sales</category>
sales ^sales
</methods> <methods> Examples.BG_Sales <category>initialize</category>
initialize "Create a ValueHolder containing a list of sales items." | item | super initialize. sales := List new. item := BG_SalesItem new. item month: 'Oct'; salesWin: 16; salesMac: 5. sales add: item. item := BG_SalesItem new. item month: 'Nov'; salesWin: 35; salesMac: 15. sales add: item. item := BG_SalesItem new. item month: 'Dec'; salesWin: 56; salesMac: 5. sales add: item. sales := sales asValue.
</methods> <methods> Examples.BG_Sales class <category>markedAsSystemClass</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.BG_PieChartView <category>accessing</category>
gridType "I use a polar grid" ^#polar
sortSlices "True is the default" ^sortSlices ~= false
sortSlices: aValue sortSlices := aValue
</methods> <methods> UI.BG_PieChartView <category>exploding</category>
explode ^explode
explode: anExplodingLabels explode := anExplodingLabels isString ifTrue: [Array with: anExplodingLabels] ifFalse: [anExplodingLabels]
</methods> <methods> UI.BG_PieChartView <category>shape</category>
beCircle isEllipse := false
beEllipse isEllipse := true
isEllipse ^isEllipse
</methods> <methods> UI.BG_PieChartView <category>private</category>
compose super compose. self composeData
composeData rates := self rates: self data.
composeGrid grid bounds: self plotArea. grid center: grid center radius: grid radius / 1.5. isEllipse ifFalse: [grid xyRate: 1.0]
composeLegend: size | item | item := labels asOrderedCollection. item size < size ifTrue: [item size + 1 to: size do: [:i | item add: nil]]. legend item: item. self composeLegendFrame: size
displayLabel: label angle: angle offset: o alignment: al on: gc at: p dataLocation = #inside ifTrue: [| gc2 | gc2 := gc copy. gc2 paint: self backgroundColor. gc2 displayRectangle: (grid box: label bounds by: angle origin: o alignment: al) at: p]. grid displayLabel: label angle: angle offset: o alignment: al on: gc at: p
legendSize ^self data columnSize
sortedValues ^self data
</methods> <methods> UI.BG_PieChartView <category>private-data-transformation</category>
dataFromDescriptions "I can accept only one set of data." | dataDescr labelDescr | dataDescr := descriptors detect: [:descr | descr hasData] ifNone: [BG_ChartDataSetDescription new]. labelDescr := descriptors detect: [:descr | descr hasData not] ifNone: [nil]. descriptors := labelDescr isNil ifTrue: [Array with: dataDescr] ifFalse: [Array with: dataDescr with: labelDescr]. super dataFromDescriptions
lookFromDescriptions "Ignore descriptors."
</methods> <methods> UI.BG_PieChartView <category>private-default-model</category>
defaultDescriptorsFor: unused "I use only one data series" ^super defaultDescriptorsFor: 1
defaultModelFor: dataDescriptor "Answer a default model. The default model is a List containing arrays. Note that the last column cotains labels." | dataPoints defModel labelIndex dataIndex | dataDescriptor nbrOfDataSeries > 1 ifTrue: [| series first | first := true. series := dataDescriptor series select: [:s | s isData ifFalse: [true] ifTrue: [first ifTrue: [first := false. true] ifFalse: [false]]]. dataDescriptor series: series]. dataPoints := 7. labelIndex := dataDescriptor labelIndex. dataIndex := labelIndex = 1 ifTrue: [2] ifFalse: [1]. labelIndex > 0 ifTrue: [defModel := Array new: dataPoints. 1 to: dataPoints do: [:i | | val | val := Array new: 2. val at: labelIndex put: (String with: ($a asInteger - 1 + i) asCharacter). val at: dataIndex put: i. defModel at: i put: val]] ifFalse: [defModel := Array new: dataPoints. 1 to: dataPoints do: [:i | defModel at: i put: i]]. ^defModel
</methods> <methods> UI.BG_PieChartView <category>legend</category>
legend: collectionOfStrings super legend: collectionOfStrings. self labels: collectionOfStrings
</methods> <methods> UI.BG_PieChartView <category>data</category>
dataAdjacent dataLocation := #adjacent
dataAdjacentWithLine dataLocation := #adjacentLine
dataBelow dataLocation := #below
dataBelowWithLine dataLocation := #belowLine
</methods> <methods> UI.BG_PieChartView <category>labels</category>
doughnutLabel ^doughnutLabel item
doughnutLabel: aString doughnutLabel item: aString
doughnutLabelStyle ^doughnutLabel
</methods> <methods> UI.BG_PieChartView <category>displaying</category>
displayAxisOn: aGraphicsContext | withLabel images dimages savedLabels newLabels v isP isZ savedData gc prevRectClt | self isLegendVisible ifTrue: [^self]. isZ := self isZeroSuppress. (withLabel := self isDataOutside) ifTrue: [savedLabels := grid x labels. images := grid x labels. (isP := self isPercentage) ifTrue: [savedData := self data. self data: (self roundedRates: rates)]. dimages := dataStyle individualImages. newLabels := Array new: self data columnSize. 1 to: newLabels size do: [:i | | n | n := sortedIndex at: i. (dataLocation = #adjacent or: [dataLocation = #adjacentLine]) ifTrue: [ | labelList | labelList := BG_IconicLabel icon: ((BG_Label item: (images at: i)) foregroundColor: grid x labelsStyle foregroundColor; yourself) item: ((BG_Label item: (dimages at: n@1)) foregroundColor: dataStyle foregroundColor; yourself). labelList gap: 4. labelList alignment: 1. newLabels at: i put: labelList] ifFalse: [ | labelList | labelList := BG_LabelList item: (Array with: ((BG_Label item: (images at: i)) foregroundColor: grid x labelsStyle foregroundColor; yourself) with: ((BG_Label item: (dimages at: n@1)) foregroundColor: dataStyle foregroundColor; yourself)). labelList beVertical. labelList alignment: 2. newLabels at: i put: labelList]]. grid x labels: newLabels. grid x scale sourceMin: 0 max: 1]. prevRectClt := OrderedCollection new. prevRectClt add: (0@0 corner: 0@0). gc := aGraphicsContext copy. images := grid x labelsStyle individualImages. v := 1.0. rates columnSize to: 1 by: -1 do: [:i | | n r | r := rates at: (n := sortedIndex at: i)@1. (isZ and: [r <= 0]) ifFalse: [| h dl p1 p2 image myBounds | h := v - (r /2). dl := #(inside adjacent below adjacentLine belowLine) indexOf: dataLocation. dl := r <= 0.1 ifTrue: [#(4 -1 4 5 4 5) at: dl + 1] ifFalse: [dl]. dl = -1 ifFalse: [ (explode notNil and: [explode includes: (labels at: n)]) ifTrue: [p1 := grid applyTo: h@(dl >= 4 ifTrue: [1.3] ifFalse: [1.2]). p2 := grid applyTo: h@0.9] ifFalse: [p1 := grid applyTo: h@(dl >= 4 ifTrue: [1.2] ifFalse: [1.0]). p2 := grid applyTo: h@0.7]. image := images at: i. dl >= 4 ifTrue: [[myBounds := p1 rounded + (grid box: image bounds by: (grid theta scale applyTo: h) origin: 5@0 alignment: 4) origin extent: image bounds extent. (prevRectClt select: [:p | p intersects: myBounds]) isEmpty or: [h < 0]] whileFalse: [h := h - 0.005. p1 := (grid applyTo: h@((explode notNil and: [explode includes: (labels at: n)]) ifTrue: [dl >= 4 ifTrue: [1.4] ifFalse: [1.3]] ifFalse: [dl >= 4 ifTrue: [1.3] ifFalse: [1.1]])) rounded]. prevRectClt add: myBounds. (LineSegment from: p1 to: p2) asStroker displayOn: gc]. grid displayLabel: image angle: (grid theta scale applyTo: h) offset: 5@0 alignment: 4 on: gc at: p1 rounded]]. v := v - r]. withLabel ifTrue: [isP ifTrue: [self data: savedData]. grid x labels: savedLabels. grid x scale sourceMin: 0 max: 1].
displayDataOn: aGraphicsContext | v savedData images image isP isZ gc prevRectClt | (self isLegendVisible not and: [dataLocation ~= #outside and: [dataLocation ~= #hide]]) ifTrue: [^self]. (isP := self isPercentage) ifTrue: [savedData := self data. self data: (self roundedRates: rates)]. isZ := self isZeroSuppress. prevRectClt := OrderedCollection new. prevRectClt add: (0@0 corner: 0@0). v := 1. gc := aGraphicsContext copy. images := dataStyle individualImages. rates columnSize to: 1 by: -1 do: [:i | | n r | r := rates at: (n := sortedIndex at: i)@1. (isZ and: [r <=0]) ifFalse: [| h dl p1 p2 myBounds | h := v - (r /2). dl := #(inside adjacent below adjacentLine belowLine) indexOf: dataLocation. dl := r <= 0.1 ifTrue: [#[4 4 5 4 5] at: dl] ifFalse: [dl]. (explode notNil and: [explode includes: (labels at: n)]) ifTrue: [p1 := (grid applyTo: h@(#(0.8 1.2 1.2 1.3 1.3) at: dl)) rounded. p2 := grid applyTo: h@0.9] ifFalse: [p1 := (grid applyTo: h@(#(0.6 1.0 1.0 1.2 1.2) at: dl)) rounded. p2 := grid applyTo: h@0.7]. ((dataLocation = #inside and: [r <= 0.1]) and: [self isLegendVisible not]) ifTrue: [ image := BG_IconicLabel icon: ((BG_Label item: (grid x labelsStyle individualImages at: n)) foregroundColor: grid x labelsStyle foregroundColor; yourself) item: ((BG_Label item: (images at: n)) foregroundColor: dataStyle foregroundColor; yourself). image gap: 4. image alignment: 1] ifFalse: [image := images at: n@1]. dl >= 4 ifTrue: [[myBounds := p1 rounded + (grid box: image bounds by: (grid theta scale applyTo: h) origin: 5@0 alignment: 4) origin extent: image bounds extent. (prevRectClt select: [:p | p intersects: myBounds]) isEmpty or: [h < 0]] whileFalse: [h := h - 0.005. p1 := (grid applyTo: h@(((explode notNil and: [explode includes: (labels at: n)]) ifTrue: [#(0.8 1.3 1.3 1.4 1.4)] ifFalse: [#(0.6 1.1 1.1 1.3 1.3)]) at: dl)) rounded]. prevRectClt add: myBounds. (LineSegment from: p1 to: p2) asStroker displayOn: gc]. self displayLabel: image angle: (grid theta scale applyTo: h) offset: (dl = 1 ifTrue: [0@0] ifFalse: [5@0]) alignment: (dl = 1 ifTrue: [5] ifFalse: [4]) on: gc at: p1. v := v - r]]. isP ifTrue: [self data: savedData].
displayGridLinesOn: aGraphicsContext ^self
displayPlotOn: aGraphicsContext | oldAngle newAngle v | oldAngle := grid theta scale applyTo: 0. v := 0. 1 to: rates columnSize do: [:i | | n ep h gc wedge | n := (self sortSlices) ifTrue: [sortedIndex at: i] ifFalse: [ i ]. (explode notNil and: [explode includes: (labels at: n)]) ifTrue: [h := v + ((rates at: n@1) / 2). ep := ((grid applyTo: h@0.2) - grid center) rounded] ifFalse: [ep := 0@0]. v := v + (rates at: n@1). newAngle := grid theta scale applyTo: v. gc := self setClientDataFor: aGraphicsContext index: n foreground: false. wedge := EllipticalArc boundingBox: grid insetBounds startAngle: oldAngle sweepAngle: newAngle-oldAngle. wedge sweepAngle > 0.1 ifTrue: [(BG_ChartElement on: wedge) displayOn: gc at: ep]. oldAngle := newAngle]. (doughnutLabel item isNil or: [doughnutLabel item isEmpty]) ifFalse: [| rect elp | rect := (0@0 extent: 0.3@0.3) rectangleRelativeTo: grid insetBounds. elp := EllipticalArc boundingBox: (rect align: rect center with: grid center). (BG_ChartElement on: elp) displayOn: aGraphicsContext. doughnutLabel displayOn: aGraphicsContext at: (doughnutLabel bounds align: doughnutLabel bounds center with: grid center) origin]
</methods> <methods> UI.BG_PieChartView <category>grid</category>
transpose
</methods> <methods> UI.BG_PieChartView <category>initialize-release</category>
initialize | newGrid | super initialize. newGrid := BG_ChartPolarGrid new. newGrid theta: grid x. newGrid theta manualAxis. newGrid theta scale: (BG_ChartScale min: 0 max: 1). newGrid r: grid y. newGrid r scale: (BG_ChartScale min: 0 max: 1). grid := newGrid. grid startAngle: -90 stopAngle: 270. dataLocation := #below. dataStyle percent. other := ''. isEllipse := false. doughnutLabel :=BG_Label new.
newGraphicsDevice: aGraphicsDevice super newGraphicsDevice: aGraphicsDevice. doughnutLabel newGraphicsDevice: aGraphicsDevice.
</methods> <methods> UI.BG_DataPointMarker <category>displaying</category>
displayImageOn: aGraphicsContext preferences: pref aGraphicsContext paint: pref foregroundColor. borderImage displayOn: aGraphicsContext at: borderImage bounds center negated. internalImage == nil ifFalse: [aGraphicsContext paint: pref backgroundColor. internalImage displayOn: aGraphicsContext at: internalImage bounds center negated].
displayOn: aGraphicsContext | pref | pref := aGraphicsContext clientDataAt: #chartElement ifAbsent: [nil]. pref == nil ifTrue: [pref := self lookPreferences]. (self usePathsOn: aGraphicsContext) ifTrue: [self displayPathOn: aGraphicsContext preferences: pref] ifFalse: [self displayImageOn: aGraphicsContext preferences: pref]
displayPathOn: aGraphicsContext preferences: pref | scaledPath | scaledPath := path scaledBy: borderImage bounds extent. internalImage == nil ifTrue: [aGraphicsContext paint: pref foregroundColor] ifFalse: [aGraphicsContext paint: pref backgroundColor]. aGraphicsContext translateBy: scaledPath bounds center negated. scaledPath displayFilledOn: aGraphicsContext. aGraphicsContext paint: pref foregroundColor. scaledPath displayStrokedOn: aGraphicsContext
usePathsOn: aGraphicsContext ^(aGraphicsContext medium screen isMemberOf: Screen) not
</methods> <methods> UI.BG_DataPointMarker <category>initialize-release</category>
borderImage: image1 internalImage: image2 borderImage := image1. internalImage := image2
image: image1 borderImage := image1. internalImage := nil
path: aGeometric path := aGeometric
</methods> <methods> UI.BG_DataPointMarker <category>scaling</category>
magnifiedBy: aScale ^self class new borderImage: (borderImage image magnifiedBy: aScale) internalImage: (internalImage image magnifiedBy: aScale)
</methods> <methods> UI.BG_DataPointMarker class <category>class initialization</category>
eraseBorderPixelsOn: image1 | image2 bounds w h | image2 := image1 copy. bounds := image2 bounds. w := bounds width. h := bounds height. image2 copy: (0@0 extent: 1@h) from: 0@0 in: nil rule: RasterOp writeZeros. image2 copy: (0@0 extent: w@1) from: 0@0 in: nil rule: RasterOp writeZeros. image2 copy: (w-1@0 extent: 1@h) from: 0@0 in: nil rule: RasterOp writeZeros. image2 copy: (0@(h-1) extent: w@1) from: 0@0 in: nil rule: RasterOp writeZeros. image2 copy: bounds from: 0@1 in: image1 rule: RasterOp and. image2 copy: bounds from: 1@0 in: image1 rule: RasterOp and. image2 copy: bounds from: 0@-1 in: image1 rule: RasterOp and. image2 copy: bounds from: -1@0 in: image1 rule: RasterOp and. ^image2
initialize "BG_DataPointMarker initialize." NamedMarkers := IdentityDictionary new. self initializeSquares. self initializeCircles. self initializeDiamonds. self initializeTriangles. self initializeExtras.
initializeCircles "BG_DataPointMarker initializeCircles" | circle1 circle2 path | path := Circle center: 0.5@0.5 radius: 0.5. circle1 := Image extent: 8 @ 8 depth: 1 palette: CoveragePalette monoMaskPalette bits: #[60 126 255 255 255 255 126 60] pad: 8. circle2 := self eraseBorderPixelsOn: circle1. circle1 := CachedImage on: circle1. circle2 := CachedImage on: circle2. self imageAt: #circle put: (self new borderImage: circle1 internalImage: circle2; path: path). self imageAt: #solidCircle put: (self new image: circle1; path: path).
initializeDiamonds "BG_DataPointMarker initializeDiamonds" | diamond1 diamond2 path | path := Polyline vertices: ((Array with: 1@0.5 with: 0.5@1 with: 0@0.5 with: 0.5@0) copyWith: 1@0.5). diamond1 := Image extent: 8 @ 8 depth: 1 palette: CoveragePalette monoMaskPalette bits: #[24 60 126 255 255 126 60 24 ] pad: 8. diamond2 := self eraseBorderPixelsOn: diamond1. diamond1 := CachedImage on: diamond1. diamond2 := CachedImage on: diamond2. self imageAt: #diamond put: (self new borderImage: diamond1 internalImage: diamond2; path: path). self imageAt: #solidDiamond put: (self new image: diamond1; path: path).
initializeExtras "BG_DataPointMarker initializeExtras" | image path | path := Polyline vertices: (Array with: 0.5@1 with: 0.5@0 with: 0.5@0.5 with: 1@0.5), (Array with: 0@0.5 with: 0.5@0.5). image := Image extent: 8 @ 8 depth: 1 palette: CoveragePalette monoMaskPalette bits: #[16 16 16 254 16 16 16 0 ] pad: 8. image := CachedImage on: image. self imageAt: #cross put: (self new image: image; path: path). path := Polyline vertices: (Array with: 1@1 with: 0@0 with: 0.5@0.5 with: 1@0), (Array with: 0@1 with: 0.5@0.5). image := Image extent: 9 @ 9 depth: 1 palette: CoveragePalette monoMaskPalette bits: #[128 128 65 0 34 0 20 0 8 0 20 0 34 0 65 0 128 128] pad: 8. image := CachedImage on: image. self imageAt: #x put: (self new image: image; path: path).
initializeSquares "BG_DataPointMarker initializeSquares" | square1 square2 path | path := Polyline vertices: ((Array with: 1@1 with: 0@1 with: 0@0 with: 1@0) copyWith: 1@1). square1 := Image extent: 8 @ 8 depth: 1 palette: CoveragePalette monoMaskPalette bits: #[255 255 255 255 255 255 255 255 ] pad: 8. square2 := self eraseBorderPixelsOn: square1. square1 := CachedImage on: square1. square2 := CachedImage on: square2. self imageAt: #square put: (self new borderImage: square1 internalImage: square2; path: path). self imageAt: #solidSquare put: (self new image: square1; path: path).
initializeTriangles "BG_DataPointMarker initializeTriangles" | triangle1 triangle2 path | path := Polyline vertices: (Array with: 1@1 with: 0@1 with: 0.5@0 with: 1@1). triangle1 := Image extent: 8 @ 8 depth: 1 palette: CoveragePalette monoMaskPalette bits: #[24 60 60 126 126 255 255 255 ] pad: 8. triangle2 := self eraseBorderPixelsOn: triangle1. triangle1 := CachedImage on: triangle1. triangle2 := CachedImage on: triangle2. self imageAt: #triangle put: (self new borderImage: triangle1 internalImage: triangle2; path: path). self imageAt: #solidTriangle put: (self new image: triangle1; path: path). path := Polyline vertices: (Array with: 1@0 with: 0@0 with: 0.5@1 with: 1@0). triangle1 := Image extent: 8 @ 8 depth: 1 palette: CoveragePalette monoMaskPalette bits: #[255 255 255 126 126 60 60 24 ] pad: 8. triangle2 := self eraseBorderPixelsOn: triangle1. triangle1 := CachedImage on: triangle1. triangle2 := CachedImage on: triangle2. self imageAt: #triangle2 put: (self new borderImage: triangle1 internalImage: triangle2; path: path). self imageAt: #solidTriangle2 put: (self new image: triangle1; path: path).
</methods> <methods> UI.BG_DataPointMarker class <category>constants</category>
imageAt: markerName ^NamedMarkers at: markerName ifAbsent: [nil]
imageAt: markerName put: marker NamedMarkers at: markerName put: marker
</methods> <methods> Examples.BG_Employee <category>name</category>
name ^name
</methods> <methods> Examples.BG_Employee <category>salary</category>
salary ^salary
</methods> <methods> Examples.BG_Employee <category>salary:</category>
salary: aValue salary := aValue
</methods> <methods> Examples.BG_Employee <category>name:</category>
name: aValue name := aValue
</methods> <methods> Examples.BG_Employee <category>age</category>
age ^age
</methods> <methods> Examples.BG_Employee <category>age:</category>
age: aValue age := aValue
</methods> <methods> UI.ChartingAxisSpec <category>accessing</category>
axisLine ^axisLine ~= false
axisLine: aValue axisLine := aValue
borderLine ^borderLine ~= false
borderLine: aValue borderLine := aValue
scale ^scale
scale: aValue scale := aValue
sectionLine ^sectionLine ~= false
sectionLine: aValue sectionLine := aValue
sectionMarkAt ^sectionMarkAt isNil ifTrue: [#majorMarks] ifFalse: [sectionMarkAt]
sectionMarkAt: aValue sectionMarkAt := aValue
tickPosition ^tickPosition isNil ifTrue: [#hideTick] ifFalse: [tickPosition]
tickPosition: aValue tickPosition := aValue
title ^title
title: aValue title := aValue
unit ^unit
unit: aValue unit := aValue
</methods> <methods> UI.ChartingAxisSpec <category>private-interface building</category>
insertIntoAxis: anAxis with: aBuilder "Set the parameters of an existing axis to reflect those set in an axis spec" | marks | self insertScalePart: anAxis with: aBuilder. title notNil ifTrue: [title isEmpty ifTrue: [title := nil]. anAxis title: (self getStringFrom: title with: aBuilder)]. unit notNil ifTrue: [anAxis unit: (self getStringFrom: unit with: aBuilder)]. tickPosition notNil ifTrue: [anAxis perform: tickPosition]. borderLine notNil ifTrue: [self borderLine ifTrue: [anAxis showBorderLine] ifFalse: [anAxis hideBorderLine]]. axisLine notNil ifTrue: [self axisLine ifTrue: [anAxis showAxisLine] ifFalse: [anAxis hideAxisLine]]. (marks := sectionMarkAt) notNil ifTrue: [marks == #none ifTrue: [anAxis hideSectionLine] ifFalse: [anAxis showSectionLine. anAxis sectionMarkAt: sectionMarkAt]]
insertScalePart: anAxis with: aBuilder "This method deals with the differences in spec and view implementations. Some parameters from scale spec on the implementation side are stored in an axis" scale notNil ifTrue: [scale autoScaleSet ifTrue: [scale autoScale ifTrue: [anAxis autoScale] ifFalse: [anAxis manualScale]]. anAxis scale scaleType == scale scaleType ifFalse: ["it is time to create new scale, I can use default since the spec will set all aspects" anAxis newScaleOfType: scale scaleType]. scale insertIntoScale: anAxis scale]
</methods> <methods> UI.ChartingAxisSpec <category>copying</category>
postCopy scale := scale copy
</methods> <methods> UI.ChartingAxisSpec <category>private</category>
fromLiteralArrayEncoding: anArray super fromLiteralArrayEncoding: anArray. "Scale is a literal array. At this point and I have to decode it." scale := scale decodeAsLiteralArray.
simplified "First simplify the scale spec and then use default criterion." scale notNil ifTrue: [scale := scale simplified]. ^super simplified.
</methods> <methods> UI.ChartingAxisSpec class <category>private-interface building</category>
addBindingsTo: env for: inst channel: aChannel super addBindingsTo: env for: inst channel: aChannel. env at: #title put: (self adapt: inst forAspect: #title channel: aChannel). env at: #unit put: (self adapt: inst forAspect: #unit channel: aChannel). env at: #axisLine put: (self adapt: inst forAspect: #axisLine channel: aChannel). env at: #sectionLine put: (self adapt: inst forAspect: #sectionLine channel: aChannel). env at: #borderLine put: (self adapt: inst forAspect: #borderLine channel: aChannel). env at: #sectionMarks put: (self adapt: inst forAspect: #sectionMarkAt channel: aChannel). env at: #tickPosition put: (self adapt: inst forAspect: #tickPosition channel: aChannel). env at: #tickPositionMenu put: self tickPositionMenuSpec asValue. env at: #sectionMarksMenu put: self labelPositionMenuSpec asValue.
</methods> <methods> UI.ChartingAxisSpec class <category>private</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.BG_TextLabel <category>accessing</category>
extent ^self bounds extent
</methods> <methods> UI.BG_XYChartView <category>private</category>
composeGrid | matrix | grid x isAutoScaled & grid x isAutoLabeled ifTrue: [matrix := self dataRangeMatrixX. grid x scale autoMin: (self min: matrix) max: (self max: matrix)]. grid y isAutoScaled & grid y isAutoLabeled ifTrue: [matrix := self dataRangeMatrix. grid y scale autoMin: (self min: matrix) max: (self max: matrix)]. grid bounds: self plotArea.
composeLabels: size
composeSortIndex: sortedValues
dataRangeMatrix ^self data collect: [:p | p y]
dataRangeMatrixX ^self data collect: [:p | p x]
</methods> <methods> UI.BG_XYChartView <category>initialize-release</category>
initialize super initialize. grid x dataAxis. showMarker := true. self hideLine
</methods> <methods> UI.BG_XYChartView <category>displaying</category>
displayDataOn: aGraphicsContext | value images angle ofs gc | value := self data. gc := aGraphicsContext copy. images := dataStyle individualImages. angle := self defaultDataAngle. ofs := 7. 1 to: value columnSize do: [:x | 1 to: value rowSize do: [:y | | n v | n := x. v := value at: n@y. grid displayLabel: (images at: n@y) angle: angle offset: (self defaultDataOffset: v y offset: ofs) alignment: (self defaultDataAlignment: v y) on: gc at: (grid applyTo: v) rounded]]
displayPlotOn: aGraphicsContext | collection value | value := self data. collection := grid applyToValues: self data. 1 to: value rowSize do: [:y | self displayLineAndMarkerOn: aGraphicsContext at: y points: (collection rowAt: y)]
</methods> <methods> UI.BG_XYChartView <category>private-default-model</category>
defaultModelFor: dataDescriptor "Answer a default model for specified number of series. The default model is a List containing arrays. Each element of the array is a point. Note that some columns cotain labels." | defModel xRange inc x | defModel := super defaultModelFor: dataDescriptor. xRange := self grid x isAutoScaled ifTrue: [self defaultRange] ifFalse: [self grid x scale sourceMin to: self grid x scale sourceMax]. inc := xRange last - xRange first / (defModel size + 2). x := xRange first + inc. dataDescriptor columns < 2 ifTrue: [1 to: defModel size do: [:i | | val | val := defModel at: i. defModel at: i put: x @ val. x := x + inc]] ifFalse: [defModel do: [:row | 1 to: row size do: [:i | | y | y := row at: i. row at: i put: x @ y]. x := x + inc]]. ^defModel
</methods> <methods> UI.BG_TableAdaptor <category>initialize-release</category>
adaptors ^adaptors
adaptors: aRowAdaptors adaptors := aRowAdaptors
baseCollection ^baseCollection
baseCollection: aCollection baseCollection := aCollection
baseCollection: aCollection adaptors: aRowAdaptor self baseCollection: aCollection. self adaptors: aRowAdaptor
</methods> <methods> UI.BG_TableAdaptor <category>enumerating</category>
collect: aBlock | new | new := self species columns: self columnSize rows: self rowSize. self keysAndValuesDo: [:key :value | new atPoint: key put: (aBlock value: value)]. ^new
column: x do: aBlock 1 to: self rowSize do: [:y | aBlock value: (self atPoint: x@y)]
column: x inject: thisValue into: binaryBlock "Accumulate a running value associated with evaluating the argument, binaryBlock, with the current value and the receiver as block arguments. The initial value is the value of the argument, thisValue." "For example, to sum a collection, use: collection inject: 0 into: [:subTotal :next | subTotal + next]." | nextValue | nextValue := thisValue. self column: x do: [:each | nextValue := binaryBlock value: nextValue value: each]. ^nextValue
keysAndValuesDo: aBlock "Evaluate aBlock with each of the receiver's key/value pairs (e.g. indexes and elements) as the arguments." 1 to: self rowSize do: [:y | 1 to: self columnSize do: [:x | aBlock value: x@y value: (self atPoint: x@y)]]
</methods> <methods> UI.BG_TableAdaptor <category>accessing</category>
at: anIndex ^anIndex indexAccessInto: self
at: anIndex put: anElement ^anIndex indexAccessInto: self put: anElement
atInteger: anInteger ^self atPoint: (self pointIndexFor: anInteger)
atInteger: anInteger put: aValue ^self atPoint: (self pointIndexFor: anInteger) put: aValue
atPoint: aPoint "Get the proper adaptor and and answer the rendering value using an object from collection as a subject." | adaptor | ^(adaptor := adaptors at: aPoint y) isNil ifTrue: [baseCollection at: aPoint x] ifFalse: [adaptor renderingValueUsingSubject: (baseCollection at: aPoint x)]
atPoint: aPoint put: aValue "Get the proper adaptor and put block and use it to store aValue in the column." | adaptor | ^(adaptor := adaptors at: aPoint y) isNil ifTrue: [baseCollection at: aPoint x put: aValue] ifFalse: [adaptor setValueUsingTarget: (baseCollection at: aPoint x) to: aValue]
columnAt: anInteger "Answer a collection containing items from the given row." | coll | coll := Array new: self rowSize. 1 to: self rowSize do: [:i | coll at: i put: (self atPoint: anInteger @ i)]. ^coll
columnAt: anInteger put: aCollection "Replace values at a given colmun with a values from aCollection." self rowSize == aCollection size ifFalse: [self error: (#WrongSizeOfColumn << #BGOK >> 'Wrong size of column.')]. 1 to: self rowSize do: [:r | self atPoint: anInteger @ r put: (aCollection at: r)]. dependents == nil ifFalse: [self changed: #atRow: with: anInteger]
columnSize ^baseCollection size
defaultElement ^baseCollection defaultElement
dimensions ^self columnSize @ self rowSize
rowAt: y | result | result := Array new: self columnSize. 1 to: result size do: [:x | result at: x put: (self atPoint: x@y)]. ^result
rowSize "Answer the number of rows in the table" ^adaptors size
size "Answer the total number of elements in the table." ^self rowSize * self columnSize
</methods> <methods> UI.BG_TableAdaptor <category>copying</category>
postCopy "Answer a copy of the receiver." super postCopy. self breakDependents. baseCollection := baseCollection copy. adaptors := adaptors copy.
</methods> <methods> UI.BG_TableAdaptor <category>private</category>
myDependents ^dependents
myDependents: anObject dependents := anObject
pointIndexFor: anInteger | base | base := (anInteger-1) // self rowSize. ^(base + 1)@(anInteger - (base*self rowSize))
</methods> <methods> UI.BG_TableAdaptor class <category>instance creation</category>
columns: columnSize rows: rowSize "BG_TableAdaptor columns: 10 rows: 3" | adaptors collection | collection := Array new: columnSize. 1 to: collection size do: [:i | collection at: i put: (Array new: rowSize)]. adaptors := Array new: rowSize. 1 to: adaptors size do: [:i | adaptors at: i put: (IndexedAdaptor forIndex: i)]. ^self on: collection adaptors: adaptors
on: aBaseCollection adaptors: aCollectionOfAdaptors | inst | inst := self basicNew. inst baseCollection: aBaseCollection adaptors: aCollectionOfAdaptors. ^inst
withRow: aList | data | data := Array new: aList size. aList keysAndValuesDo: [:i :v | data at: i put: (Array with: v)]. ^self on: data adaptors: (Array with: (IndexedAdaptor forIndex: 1))
withRowData: aList "Answer an instance containing as many rows as are elemnts in aList" | rows columns new row | aList isEmpty ifTrue: [^self columns: 0 rows: 0]. rows := aList size. columns := aList first size. new := self columns: columns rows: rows. 1 to: aList size do: [:y | row := aList at: y. row size = columns ifFalse: [self error: (#GenKey1 << #BGOK >> 'All rows are not the same size')]. 1 to: columns do: [:x | new atPoint: x@y put: (row at: x)]]. ^new
</methods> <methods> Tools.ChartScaleSpecModel <category>interface opening</category>
postBuildWith: aBuilder "Update the state of the input fields in order to disable some of them." super postBuildWith: aBuilder. self disableRangeButtons: autoScale value. self changedScaleType: scaleType value. self addRestrictions: specChannel value. autoScale compute: [:v | v ifFalse: [self switchToManual]. self disableRangeButtons: v]. scaleType compute: [:v | self changedScaleType: v]
</methods> <methods> Tools.ChartScaleSpecModel <category>accessing</category>
autoScale ^autoScale
base ^base
invert ^invert
max ^max
min ^min
minorDivisions ^minorDivisions
scaleType ^scaleType
specChannel: aValueHolder "All aspects are dependent of a spec channel. So any changes are propagated to the parent model." super specChannel: aValueHolder. min := (AspectAdaptor subjectChannel: aValueHolder) forAspect: #min. max := (AspectAdaptor subjectChannel: aValueHolder) forAspect: #max. zero := (AspectAdaptor subjectChannel: aValueHolder) forAspect: #zero. minorDivisions := (AspectAdaptor subjectChannel: aValueHolder) forAspect: #minorDivisions. base := (AspectAdaptor subjectChannel: aValueHolder) forAspect: #base. invert := (AspectAdaptor subjectChannel: aValueHolder) forAspect: #invert. autoScale := (AspectAdaptor subjectChannel: aValueHolder) forAspect: #autoScale. scaleType := (AspectAdaptor subjectChannel: aValueHolder) forAspect: #scaleType. step := (AspectAdaptor subjectChannel: aValueHolder) forAspect: #step
step ^step
zero ^zero
</methods> <methods> Tools.ChartScaleSpecModel <category>private</category>
addRestrictions: aSpec "Check if we are dealing with the restricted version of the scale" | restr | restr := aSpec restrictions. (restr includes: #auto) ifTrue: [self disableRangeButtons: true. (builder componentAt: #autoScaleBox) disable]. (restr includes: #zero) ifTrue: [(builder componentAt: #zeroField) disable. (builder componentAt: #zeroLabel) disable]. (restr includes: #div) ifTrue: [(builder componentAt: #divField) disable. (builder componentAt: #divLabel) disable]. (restr includes: #log) ifTrue: [(builder componentAt: #scaleLog) disable]
changedScaleType: newType "The scale type has changed. If the new type is #log then: enable base field and put 10 into it (if not defined)" newType == #log ifTrue: [(builder componentAt: #baseField) enable. (builder componentAt: #baseLabel) enable. base value isNil ifTrue: [base value: 10]] ifFalse: [(builder componentAt: #baseField) disable. (builder componentAt: #baseLabel) disable]
disableRangeButtons: aValue "If aValue is true disable range buttons." #(#minField #maxField #stepField #minLabel #maxLabel #stepLabel) do: [:sym | | comp | comp := builder componentAt: sym. aValue ifTrue: [comp disable] ifFalse: [comp enable]]
switchToManual min value isNil ifTrue: [min value: (self scaleType value == #normal ifTrue: [0] ifFalse: [1])]. max value isNil ifTrue: [max value: 100]. step value isNil ifTrue: [step value: 20]
</methods> <methods> Tools.ChartScaleSpecModel class <category>private</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.BG_ParatoChartView <category>private</category>
composeGrid | insetArea max bounds | super composeGrid. bounds := grid insetBounds. auxGrid x: grid x. auxGrid x scale reverse. auxGrid bounds: self plotArea. auxGrid x scale reverse. insetArea := bounds intersect: auxGrid insetBounds. grid insetBounds: insetArea. auxGrid insetBounds: insetArea. max := self max: self dataRangeMatrix. auxGrid transposed ifTrue: [auxGrid y scale destMin: auxGrid y scale destMin max: (grid y scale applyTo: max)] ifFalse: [auxGrid y scale destMin: (grid y scale applyTo: max) max: auxGrid y scale destMax]
dataRangeMatrix ^Array with: 0 with: (self sum: self data)
</methods> <methods> UI.BG_ParatoChartView <category>grid</category>
auxGrid ^auxGrid
transpose super transpose. auxGrid transpose. auxGrid y scale reverse
</methods> <methods> UI.BG_ParatoChartView <category>labels</category>
labels: collectionOfStrings super labels: collectionOfStrings. auxGrid x labels: labels copy
</methods> <methods> UI.BG_ParatoChartView <category>initialize-release</category>
initialize super initialize. other := 'others'. barWidth := 1.0. auxGrid := BG_ChartGrid new. auxGrid x itemAxis. auxGrid y fixedDataAxis. auxGrid y scale: (BG_ChartScale min: 0 max: 1 by: 0.5 from: 0 div: 5) decrease. auxGrid y labelsStyle percent; integer
newGraphicsDevice: aGraphicsDevice super newGraphicsDevice: aGraphicsDevice. auxGrid newGraphicsDevice: aGraphicsDevice.
</methods> <methods> UI.BG_ParatoChartView <category>displaying</category>
displayAxisOn: aGraphicsContext | gc | gc := aGraphicsContext copy. super displayAxisOn: gc. auxGrid x scale reverse. auxGrid transposed ifTrue: [auxGrid displayHAxisOn: aGraphicsContext. auxGrid displayHLabelsOn: aGraphicsContext] ifFalse: [auxGrid displayVAxisOn: aGraphicsContext. auxGrid displayVLabelsOn: aGraphicsContext]. auxGrid x scale reverse
displayDataOn: aGraphicsContext | value images angle rates isP gc base | value := self data. base := grid y scale zero. rates := self rates: value. (isP := self isPercentage) ifTrue: [self data: (self roundedRates: rates)]. gc := aGraphicsContext copy. images := dataStyle individualImages. angle := self defaultDataAngle. 1 to: value columnSize do: [: i | | n v py | n := sortedIndex at: i. v := value at: n@1. py := dataLocation = #outside ifTrue: [v ] ifFalse: [base + (v - base // 2) ]. self displayLabel: (images at: n@1) angle: angle offset: (self defaultDataOffset: v offset: 4) alignment: (self defaultDataAlignment: v) on: gc at: (grid applyTo: i@(py)) rounded]. isP ifTrue: [self data: value].
displayPlotOn: aGraphicsContext | value points collection sum k | sum := self sum: self data. value := self data. super displayPlotOn: aGraphicsContext. points := Array new: value columnSize + 1. points at: 1 put: 0.5 @ (k := 0). 1 to: value columnSize do: [:i | | n | n := sortedIndex at: i. points at: i + 1 put: i +0.5@ (k := k + ((value at: n@1) / sum))]. collection := auxGrid applyToValues: points. (Polyline vertices: collection) asStroker displayOn: aGraphicsContext
</methods> <methods> Tools.ChartDataSpecModel <category>private</category>
buildSeriesMenu "Answer a menu containing names of the defined data series. Values correspond to indexes in the series collection. If the menu is empty answer a menu with only one item containing 'Empty->1'." | mb series | series := specChannel value series. mb := MenuBuilder new. series isNil ifTrue: [mb add: (#Empty << #BGOK >> 'Empty') -> 1] ifFalse: [1 to: series size do: [:i | | nm s | s := series at: i. nm := s name. (nm isNil or: [nm isEmpty]) ifTrue: [nm := s aspect isNil ifTrue: [''] ifFalse: [s aspect printString]]. mb add: nm -> i]]. ^mb menu
checkForDoubleLabel | coll | coll := specChannel value labelSeries. coll size > 1 ifTrue: [| name series index res | coll remove: selectedIndex value. index := coll asArray first. series := specChannel value seriesAt: index. (name := series name) isNil ifTrue: [name := series aspect isNil ifFalse: [series aspect printString] ifTrue: ['#' , index printString]]. res := Dialog choose: ((#GenKey3 << #BGOK >> 'The chart can only have one data series defining labels.<n>There is already a series <1s> marked as a label.<nn>You can cancel the last operation by pressing Cancel or<n>remove the <2s> series by pressing Remove.') expandMacrosWith: name with: name) labels: (Array with: (#Cancel << #BGOK >> 'Cancel') with: (#Remove << #BGOK >> 'Remove')) values: #(#cancel #remove ) default: #cancel for: builder window. res == #remove ifTrue: [specChannel value deleteSeriesAt: index. self updateMenuButton.] ifFalse: [isLabel value: false]]
newSeriesName "A name of selected series has changed, update the menu button." self updateMenuButton
redefinedAspect "Refresh the menu button if the name is empty." self updateMenuButton. selectedIndex value: selectedIndex value
redefinedName "Refresh the menu button." selectedIndex value: selectedIndex value
seriesDefined "Answer true if at least one series is defined." ^specChannel value series notNil
updateDialog "Check the number of series and disable or enable fields in the property dialog." | list | self updateMenuButton. list := #(#dataSeriesMenuButton #deleteButton #nameField #aspectField #labelCheckBox #colorToolButton #lineLookToolButton #regionLookToolButton #computedCheckBox #aspectLabel #nameLabel). self seriesDefined ifTrue: [list do: [:sym | (builder componentAt: sym) enable]] ifFalse: [list do: [:sym | (builder componentAt: sym) disable]]
updateMenuButton "Build a new menu to reflect changes in the series." self dataSeriesMenu value: self buildSeriesMenu.
updateSeriesLookButtons "The status of label button has changed. Action buttons controlling the look of a data series are enabled or disabled. Do nothing if no series is defined." | list comp | self seriesDefined ifFalse: [^self]. list := #(#colorToolButton #lineLookToolButton #regionLookToolButton ). self isLabel value ifTrue: [list do: [:sym | (comp := builder componentAt: sym) notNil ifTrue: [comp disable]]] ifFalse: [list do: [:sym | (comp := builder componentAt: sym) notNil ifTrue: [comp enable]]]
</methods> <methods> Tools.ChartDataSpecModel <category>aspects</category>
dataSeries ^selectedIndex
dataSeriesMenu "Answer a value holder with a menu containing names of the defined data series. Values correspond to indexes in the series collection. The delayed initalization is necessary, because an instance is created when the specChannel is unknown." menuHolder isNil ifTrue: [menuHolder := self buildSeriesMenu asValue]. ^menuHolder
isComputed "Answers true when the selected series is described by the block closure." ^isComputed.
isLabel "Answers true when the selected series is a label" ^isLabel.
seriesAspect ^seriesAspect
seriesName ^seriesName
</methods> <methods> Tools.ChartDataSpecModel <category>interface opening</category>
postBuildWith: aBuilder "Updates the state of the input fields in order to initially disable some of them." super postBuildWith: aBuilder. self updateSeriesLookButtons. self updateDialog. "(self builder componentAt: #newSeriesButton) takeKeyboardFocus"
preBuildWith: aBuilder "Update the selection index. This refreshes the data from selected data series." selectedIndex value: selectedIndex value.
</methods> <methods> Tools.ChartDataSpecModel <category>updating</category>
update: anAspectSymbol with: aParameter from: aSender "Receive a change notice from a spec channel." aSender == specChannel ifTrue: [selectedIndex value: 1. self updateDialog]
</methods> <methods> Tools.ChartDataSpecModel <category>actions</category>
colorTool "Pop up a dialog showing the color tool. If the user accepts the dialog, set background and foreground colors for the selected series." | dialog look in lookPref | lookPref := LookPreferences new. in := selectedSeries value. look := in look copy. look isNil ifTrue: [look := ChartElementLookSpec new]. dialog := ChartColorTool new. lookPref setBackgroundColor: look backgroundColor. lookPref setForegroundColor: look foregroundColor. dialog lookPreferences: lookPref. dialog open. dialog accept value ifTrue: [look backgroundColor: dialog lookPreferences backgroundColor. look foregroundColor: dialog lookPreferences foregroundColor. in look: look. self notifyParent]
deleteSeries "Remove a selected series. Move the selection to the series preceding the selected one." | indx | indx := specChannel value deleteSeriesAt: selectedIndex value. indx isNil ifTrue: [indx := 0]. self updateMenuButton. indx isZero ifTrue: [selectedIndex value: 1. self updateDialog] ifFalse: [selectedIndex value: indx]. self notifyParent.
lineLookTool "Pop up a tool (line chooser) for selecting the look of the selected data series." self lookToolFor: #line
lookToolFor: lookTypeSymbol "Pop up a tool (line or pattern chooser) for selecting the look of the selected data series." | look in | in := selectedSeries value. look := in look copy. look isNil ifTrue: [look := ChartElementLookSpec new]. (look dialogFor: lookTypeSymbol) ifTrue: [in look: look. self notifyParent]
newSeries "Add a new series, then move the selection to the new series." | indx | indx := specChannel value addNewSeriesAfter: selectedIndex value. self updateDialog. selectedIndex value: indx. self notifyParent.
regionLookTool "Pop up a tool (fill pattern chooser) for selecting the look of the selected data series" self lookToolFor: #region
</methods> <methods> Tools.ChartDataSpecModel <category>initialize-release</category>
initialize "Initalize instance variables. Leave the specChannel, since it has to be initalized from outside. Make sure that selectedSeries is synchronized with selectedIndex." super initialize. selectedIndex := 1 asValue. selectedSeries := nil asValue. seriesName := (AspectAdaptor subjectChannel: selectedSeries) forAspect: #name. seriesAspect := (AspectAdaptor subjectChannel: selectedSeries) forAspect: #aspect. isLabel := (AspectAdaptor subjectChannel: selectedSeries) forAspect: #isLabel. isComputed := (AspectAdaptor subjectChannel: selectedSeries) forAspect: #isComputed. selectedIndex compute: [:v | selectedSeries value: (specChannel value seriesAt: v)]. seriesName onChangeSend: #newSeriesName to: self. isComputed compute: [:v | self notifyParent]. isLabel compute: [:v | self notifyParent. self updateSeriesLookButtons. v ifTrue: [self checkForDoubleLabel]]
</methods> <methods> Tools.ChartDataSpecModel class <category>private</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> Tools.ChartDataSpecModel class <category>binary storage</category>
postLoad: aParcel "The BGOK Parcel includes UIPainter code, but can be loaded with-out the UIPainter being present. If so, ChartViewSpec cannot add it self to the UIPainter's collection of Spec types, sicne UIPainter is not present. When the UIPainter is loaded this class can be installed, since it inherits from SpecModel in the UIPainter parcel. We can identify when the UIPainter is being loaded after BGOK since aParcel will be loaded. Hence when the UIPainter is loaded after BGOK we reinitialize ChartViewSpec." super postLoad: aParcel. aParcel isLoaded ifTrue: [ChartViewSpec postLoad: aParcel]
</methods> <methods> Examples.BG_Company <category>employees</category>
employees ^employees
</methods> <methods> Examples.BG_Company <category>initialize</category>
initialize "Create a list of employees, and convert it into a ValueHolder." super initialize. employees := List new. self initializeData. employees := employees asValue.
</methods> <methods> Examples.BG_Company <category>initializeData</category>
initializeData "Initalize the employees collection." |employee| employee := BG_Employee new. employee name: 'Fred'; age: 50; salary: 40. employees add: employee. employee := BG_Employee new. employee name: 'Joe'; age: 25; salary: 32. employees add: employee. employee := BG_Employee new. employee name: 'Bob'; age: 36; salary: 33. employees add: employee.
</methods> <methods> Examples.BG_Company class <category>markedAsSystemClass</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.BG_ChartElementLook <category>accessing</category>
fillMask ^fillMask
fillMask: newMaskOrNil fillMask := newMaskOrNil
lineStyle ^lineStyle
lineStyle: newStyle lineStyle := newStyle
lineWidth ^lineWidth
lineWidth: newWidth lineWidth := newWidth
lineWidthAndStyle ^Array with: self lineWidth with: self lineStyle
lineWidthAndStyle: array self lineWidth: (array at: 1). self lineStyle: (array at: 2).
marker ^marker isSymbol ifTrue: [BG_DataPointMarker imageAt: marker] ifFalse: [marker]
marker: aVisualComponent marker := aVisualComponent
</methods> <methods> UI.BG_ChartElementLook class <category>instance creation</category>
from: aLookPreferences | copy | (aLookPreferences isKindOf: self) ifTrue: [^aLookPreferences]. copy := self new. copy lineWidth: 0. copy setForegroundColor: aLookPreferences foregroundColor. copy setSelectionForegroundColor: aLookPreferences selectionForegroundColor. copy setBackgroundColor: aLookPreferences backgroundColor. copy setSelectionBackgroundColor: aLookPreferences selectionBackgroundColor. copy setBorderColor: aLookPreferences borderColor. ^copy
new ^super new lineWidth: 0; yourself
</methods> <methods> UI.BG_StackedLineChartView <category>private</category>
dataRangeMatrix | matrix value | value := self data. matrix := Array new: value columnSize. 1 to: value columnSize do: [:x | matrix at: x put: ((value columnAt: x) inject: 0 into: [:i :j | i+j])]. ^matrix
</methods> <methods> UI.BG_StackedLineChartView <category>displaying</category>
displayDataOn: aGraphicsContext | value images angle ofs gc | value := self data. gc := aGraphicsContext copy. images := dataStyle individualImages. angle := self defaultDataAngle. ofs := 7. 1 to: value columnSize do: [:x | | v | v := 0. 1 to: value rowSize do: [:y | | n | n := sortedIndex at: x. v := v + (value at: n@y). grid displayLabel: (images at: n@y) angle: angle offset: (self defaultDataOffset: v offset: ofs) alignment: (self defaultDataAlignment: v) on: gc at: (grid applyTo: x@v) rounded]]
displayPlotOn: aGraphicsContext | value points collection | value := self data. points := BG_TableAdaptor columns: value columnSize rows: value rowSize. 1 to: value columnSize do: [:x | | n v | n := sortedIndex at: x. v := 0. 1 to: value rowSize do: [:y | points at: x @y put: x@(v := v + (value at: n@y))]]. collection := grid applyToValues: points. 1 to: value rowSize do: [:y | self displayLineAndMarkerOn: aGraphicsContext at: y points: (collection rowAt: y)]
</methods> <methods> UI.BG_StackedLineChartView <category>private-default-model</category>
defaultNbrOfSeries ^2
defaultPointFor: aValue column: aColumn range: aRange | val | val := (aColumn = 1 ifTrue: [aValue] ifFalse: [aValue > 0 ifTrue: [aRange last - aValue / aColumn] ifFalse: [aRange first - aValue / aColumn]]). ^val abs > 2 ifTrue: [val asInteger] ifFalse: [val asFloat]
</methods> <methods> UI.LineChartOptionsSpec <category>accessing</category>
dataLocation dataLocation isNil ifTrue: [^#none]. ^dataLocation
dataLocation: aValue dataLocation := aValue
lineLocation ^self showLine ifTrue: [#show] ifFalse: [#hide]
lineLocation: aValue self showLine: aValue == #show
markerLocation ^self showMarker ifTrue: [#show] ifFalse: [#hide]
markerLocation: aValue self showMarker: aValue == #show
showLine ^showLine ~= false
showLine: aValue showLine := aValue
showMarker ^showMarker == true.
showMarker: aValue showMarker := aValue
spline ^spline == true
spline: aValue spline := aValue
</methods> <methods> UI.LineChartOptionsSpec <category>private-interface building</category>
insertIntoView: aChartView withBuilder: builder "Insert optional parameters into a bar chart view" dataLocation isNil ifFalse: [dataLocation == #none ifTrue: [aChartView hideData]. dataLocation == #inside ifTrue: [aChartView dataInside]. dataLocation == #outside ifTrue: [aChartView dataOutside]]. showLine isNil ifFalse: [showLine ifTrue: [aChartView showLine] ifFalse: [aChartView hideLine]]. (spline == true) ifTrue: [aChartView showSpline]. showMarker isNil ifFalse: [showMarker ifTrue: [aChartView showMarker] ifFalse: [aChartView hideMarker]]
</methods> <methods> UI.LineChartOptionsSpec class <category>private-interface building</category>
addBindingsTo: env for: inst channel: aChannel super addBindingsTo: env for: inst channel: aChannel. env at: #dataLocation put: (self adapt: inst forAspect: #dataLocation channel: aChannel). env at: #lineLocation put: (self adapt: inst forAspect: #lineLocation channel: aChannel). env at: #showSpline put: (self adapt: inst forAspect: #spline channel: aChannel). env at: #markerLocation put: (self adapt: inst forAspect: #markerLocation channel: aChannel).
</methods> <methods> UI.LineChartOptionsSpec class <category>private</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.ChartDataSpec <category>accessing</category>
columns "Answers the number of data series." ^series size
labelIndex "Answer an index of series containing label or 0." series size < 1 ifTrue: [^0] ifFalse: [series keysAndValuesDo: [:i :s | s isData ifFalse: [^i]]. ^0]
labelSeries "Answer a collection contianing indexes of series containing labels." | set | set := Set new. series size > 0 ifTrue: [series keysAndValuesDo: [:k :s | s isData ifFalse: [set add: k]]]. ^set
nbrOfDataSeries "Answer a number of series containing data" ^series size < 1 ifTrue: [0] ifFalse: [| i | i := 0. series do: [:s | s isData ifTrue: [i := i + 1]]. i]
series ^series
series: aValue series := aValue
seriesAt: index (series isNil or: [index isZero]) ifTrue: [^ChartDataSetSpec new]. series size < index ifTrue: [^ChartDataSetSpec new]. ^series at: index
seriesList ^self series isNil ifTrue: [^List new] ifFalse: [self series]
</methods> <methods> UI.ChartDataSpec <category>copying</category>
postCopy "I need a deep copy of the collection." series notNil ifTrue: [series := series collect: [:el | el copy]]
</methods> <methods> UI.ChartDataSpec <category>private-interface building</category>
dataSeriesMenu | mb | mb := MenuBuilder new. series isNil ifTrue: [mb add: (#Empty << #BGOK >> 'Empty') -> 1] ifFalse: [1 to: series size do: [:i | | nm s | s := series at: i. nm := s name. nm isNil ifTrue: [nm := s aspect isNil ifTrue: [''] ifFalse: [s aspect printString]]. mb add: nm -> i]]. ^mb menu
fromLiteralArrayEncoding: anArray "Need to unpack the chart data series." super fromLiteralArrayEncoding: anArray. series isNil ifFalse: [series := series collect: [:s | s decodeAsLiteralArray]]
insertIntoView: aChartView withBuilder: builder andPrefix: aSymbol "Iterate over the collection of specs defining the series of data." | descr | (series isNil or: [series isEmpty]) ifTrue: [aChartView useDefaultDescriptors] ifFalse: [descr := Array new: series size. 1 to: descr size do: [:i | | dd | dd := BG_ChartDataSetDescription new. "Array of arrays" descr size > 1 ifTrue: [dd adaptor: (IndexedAdaptor forIndex: i)]. (series at: i) insertIntoDescriptor: dd withBuilder: builder andPrefix: aSymbol. descr at: i put: dd]. aChartView descriptors: descr]
simplified "Note that it is possible to have Data Set Descriptors that contain only nils." ^(series isNil or: [series isEmpty]) ifTrue: [nil] ifFalse: [| newSeries | newSeries := series collect: [:ss | ss simplified]. series := newSeries select: [:ss | ss notNil]. series isEmpty ifTrue: [nil] ifFalse: [self]]
</methods> <methods> UI.ChartDataSpec <category>private-actions</category>
addNewSeriesAfter: anIndex "Add new data set descriptors spec. Answer an index of a new spec" | baby res indx | indx := anIndex isNil ifTrue: [0] ifFalse: [anIndex]. baby := ChartDataSetSpec new. series isNil ifTrue: [series := Array with: baby. res := 1] ifFalse: [| coll | coll := List new. coll addAll: series. indx = coll size ifTrue: [coll addLast: baby] ifFalse: [coll add: baby beforeIndex: indx + 1]. series := coll asArray. res := indx + 1]. baby name: ((#New1s << #BGOK >> 'New-<1s>') expandMacrosWith: res printString); aspect: #value. ^res
deleteSeriesAt: anIndex "Remove an entry at index 'anIndex'. If after removal the collection is empty replace it with nil. Answer a new index." ^series isNil ifFalse: [series size = 1 ifTrue: [series := nil. 0] ifFalse: [series := series copyWithout: (series at: anIndex). anIndex = 1 ifTrue: [1] ifFalse: [anIndex - 1]]]
</methods> <methods> UI.ChartDataSpec <category>private-validation</category>
isDataValidForChart: aChartType "Test if the data is valid for a specified chart type. Answer false if there is a problem." self simplified isNil ifTrue: [^true]. self nbrOfDataSeries < 1 ifTrue: [Dialog warn: (#GenKey2 << #BGOK >> 'You have to specify at least one data series'). ^false]. ^true
</methods> <methods> UI.ChartDataSpec class <category>instance creation</category>
new: aNumberOfSeries "Create a new instance with aNumberOfSeries data descriptors." | baby series | baby := self new. series := Array new: aNumberOfSeries. 1 to: aNumberOfSeries do: [:i | series at: i put: ChartDataSetSpec new]. baby series: series. ^baby
</methods> <methods> UI.BG_PictureChartView <category>private</category>
compose self composeLabels: self labelsSize. self composeSortIndex: self sortedValues. self composeGrid. self isLegendVisible ifTrue: [self composeLegend: 1].
composeLegend: size legend item: (Array with: unit). legend alignment: 1. self composeLegendFrame: size
legendSize ^1
</methods> <methods> UI.BG_PictureChartView <category>private-data-transformation</category>
dataFromDescriptions "I can accept only one set of data." | dataDescr labelDescr | dataDescr := descriptors detect: [:descr | descr hasData] ifNone: [BG_ChartDataSetDescription new]. labelDescr := descriptors detect: [:descr | descr hasData not] ifNone: [nil]. descriptors := labelDescr isNil ifTrue: [Array with: dataDescr] ifFalse: [Array with: dataDescr with: labelDescr]. super dataFromDescriptions
</methods> <methods> UI.BG_PictureChartView <category>picture/unit</category>
picture ^picture item
picture: anObject picture item: anObject
pictureStyle ^picture
unit ^unit
unit: aNumber unit := aNumber
</methods> <methods> UI.BG_PictureChartView <category>displaying</category>
displayLegendOn: aGraphicsContext | area iconRect gc | self legendAlignment = 0 ifTrue: [^self]. gc := self setChartElementLookUsing: aGraphicsContext. legendFrame displayOn: gc. area := legendFrame bounds insetBy: 6. iconRect := (area topLeft extent: area width - legend individualExtent x @ area height) insetBy: 3. picture autoScale. picture extent: iconRect extent. picture displayOn: aGraphicsContext at: area topLeft + (3 @ 3). legend displayOn: aGraphicsContext at: iconRect rightCenter - (-3 @ (legend height // 2))
displayPlotOn: aGraphicsContext | value uv points collection gc clip base | value := self data. base := grid y scale zero. points := Array new: value columnSize * 2. gc := aGraphicsContext copy. 1 to: value columnSize do: [:i | | n | n := sortedIndex at: i. points at: i * 2 - 1 put: i - (barWidth / 2) @ (value at: n @ 1). points at: i * 2 put: i + (barWidth / 2) @ base]. uv := ((grid applyTo: barWidth @ unit) - (grid applyTo: 0 @ 0)) abs rounded. picture extent: uv. collection := grid applyToValues: points. clip := gc clippingBounds. picture scale: 1 @ 1. picture scale: uv / picture image extent. 1 to: value columnSize do: [:i | | v p1 p2 bclip | v := value at: (sortedIndex at: i) @ 1. v := v - base. p1 := (collection at: i * 2 - 1) rounded. p2 := (collection at: i * 2) rounded. bclip := clip intersect: (Rectangle vertex: p1 vertex: p2). v >= 0 ifTrue: [1 to: (v / unit) ceiling do: [:j | p1 := (grid applyTo: (points at: i * 2 - 1) x @ (base + (unit * (j - 1)))) rounded. p2 := (grid applyTo: (points at: i * 2) x @ (base + (unit * j))) rounded. gc clippingRectangle: (bclip intersect: (Rectangle vertex: p1 vertex: p2)). picture displayOn: gc at: (p1 min: p2)]] ifFalse: [1 to: (v / unit) floor abs do: [:j | picture rotation: picture rotation + 2 \\ 4. p1 := (grid applyTo: (points at: i * 2 - 1) x @ (base + (unit * (j - 1) * -1))) rounded. p2 := (grid applyTo: (points at: i * 2) x @ (base + (unit * j * -1))) rounded. gc clippingRectangle: (bclip intersect: (Rectangle vertex: p1 vertex: p2)). picture displayOn: gc at: (p1 min: p2). picture rotation: picture rotation + 2 \\ 4]]]
</methods> <methods> UI.BG_PictureChartView <category>private-default-model</category>
defaultDescriptorsFor: numberOfSeries "I use only one data series" ^super defaultDescriptorsFor: 1
defaultModelFor: dataDescriptor "I use only one data series" dataDescriptor nbrOfDataSeries > 1 ifTrue: [| series first | first := true. series := dataDescriptor series select: [:s | s isData ifFalse: [true] ifTrue: [first ifTrue: [first := false. true] ifFalse: [false]]]. dataDescriptor series: series]. ^super defaultModelFor: dataDescriptor
</methods> <methods> UI.BG_PictureChartView <category>initialize-release</category>
initialize super initialize. legendLocation := 6. unit := 20. picture := BG_Banner new. picture item: self class defaultPicture
newGraphicsDevice: aGraphicsDevice super newGraphicsDevice: aGraphicsDevice. picture newGraphicsDevice: aGraphicsDevice.
</methods> <methods> UI.ChartingValueAxisSpec <category>accessing</category>
labelFormat ^labelFormat isNil ifTrue: [#general] ifFalse: [labelFormat]
labelFormat: aValue labelFormat := aValue
labelsMarkAt labelsMarkAt isNil ifTrue: [^#majorMarks]. ^labelsMarkAt
labelsMarkAt: aValue labelsMarkAt := aValue
tickPosition ^tickPosition isNil ifTrue: [#tickInside] ifFalse: [tickPosition]
</methods> <methods> UI.ChartingValueAxisSpec <category>private-interface building</category>
insertIntoAxis: anAxis with: aBuilder "Set the parameters of an existing axis to reflect those set in an axis spec" | marks | super insertIntoAxis: anAxis with: aBuilder. labelFormat notNil ifTrue: [anAxis setLabelFormat: labelFormat]. (marks := labelsMarkAt) notNil ifTrue: [marks == #none ifTrue: [anAxis labelsMarkAt: #noMarks] ifFalse: [anAxis labelsMarkAt: labelsMarkAt]]
</methods> <methods> UI.ChartingValueAxisSpec class <category>private-interface building</category>
addBindingsTo: env for: inst channel: aChannel super addBindingsTo: env for: inst channel: aChannel. env at: #labelPosition put: (self adapt: inst forAspect: #labelsMarkAt channel: aChannel). env at: #labelPositionMenu put: self labelPositionMenuSpec asValue. env at: #labelFormat put: (self adapt: inst forAspect: #labelFormat channel: aChannel). env at: #labelFormatMenu put: self labelFormatMenuSpec asValue.
</methods> <methods> UI.ChartingValueAxisSpec class <category>private</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.BG_IconicLabel <category>accessing</category>
icon ^icon
icon: aVisualComponent icon := aVisualComponent
</methods> <methods> UI.BG_IconicLabel <category>mode/gap</category>
gap ^gap
gap: anInteger gap := anInteger
mode ^mode
mode: anInteger mode := anInteger
</methods> <methods> UI.BG_IconicLabel <category>bounds accessing</category>
extent extent isNil ifFalse: [^extent]. icon isNil ifTrue: [^super extent]. ^self extentOfIconicLabel
</methods> <methods> UI.BG_IconicLabel <category>initialize-release</category>
initialize super initialize. mode := 0. gap := 0.
newGraphicsDevice: aGraphicsDevice super newGraphicsDevice: aGraphicsDevice. icon ifNotNil:[icon newGraphicsDevice: aGraphicsDevice].
</methods> <methods> UI.BG_IconicLabel <category>private</category>
alignIconOffset | al ext x y ax ay iconicLabelExt | x := y := 0. al := self alignmentForDisplay. ext := self extent. iconicLabelExt := self extentOfIconicLabel. mode >= 4 ifTrue: [| height | height := mode = 5 ifTrue: [iconicLabelExt y - icon bounds height] ifFalse: [0]. (ax := al - 1 \\ 3) = 0 ifFalse: [ax = 1 ifTrue: [x := ext x - icon bounds width // 2] ifFalse: [x := ext x - icon bounds width]]. (ay := al - 1 // 3) = 0 ifFalse: [ay = 1 ifTrue: [y := ext y - iconicLabelExt y // 2] ifFalse: [y := ext y - iconicLabelExt y]]. y := y + height] ifFalse: [| width | width := mode = 1 ifTrue: [iconicLabelExt x - icon bounds width] ifFalse: [0]. (ax := al - 1 \\ 3) = 0 ifFalse: [ax = 1 ifTrue: [x := ext x - iconicLabelExt x // 2] ifFalse: [x := ext x - iconicLabelExt x]]. x := x + width. (ay := al - 1 // 3) = 0 ifFalse: [ay = 1 ifTrue: [y := ext y - icon bounds height // 2] ifFalse: [y := ext y - icon bounds height]]]. ^x @ y
alignOffset: alignedObject | al ext x y ax ay iconicLabelExt | icon isNil ifTrue: [^super alignOffset: alignedObject]. x := y := 0. al := self alignmentForDisplay. ext := self extent. iconicLabelExt := self extentOfIconicLabel. mode >= 4 ifTrue: [| height | height := mode = 4 ifTrue: [iconicLabelExt y - alignedObject bounds height] ifFalse: [0]. (ax := al - 1 \\ 3) = 0 ifFalse: [ax = 1 ifTrue: [x := ext x - alignedObject bounds width // 2] ifFalse: [x := ext x - alignedObject bounds width]]. (ay := al - 1 // 3) = 0 ifFalse: [ay = 1 ifTrue: [y := ext y - iconicLabelExt y // 2] ifFalse: [y := ext y - iconicLabelExt y]]. y := y + height] ifFalse: [| width | width := mode = 0 ifTrue: [iconicLabelExt x - alignedObject bounds width] ifFalse: [0]. (ax := al - 1 \\ 3) = 0 ifFalse: [ax = 1 ifTrue: [x := ext x - iconicLabelExt x // 2] ifFalse: [x := ext x - iconicLabelExt x]]. x := x + width. (ay := al - 1 // 3) = 0 ifFalse: [ay = 1 ifTrue: [y := ext y - alignedObject bounds height // 2] ifFalse: [y := ext y - alignedObject bounds height]]]. ^x @ y
extentOfIconicLabel mode <= 1 ifTrue: [^self image bounds width + icon bounds width + gap @ (image bounds height max: icon bounds height)]. mode = 2 ifTrue: [^icon bounds extent]. mode = 3 ifTrue: [^self image bounds extent]. ^(self image bounds width max: icon bounds width) @ (image bounds height + icon bounds height + gap)
</methods> <methods> UI.BG_IconicLabel <category>displaying</category>
displayOn: aGraphicsContext at: aPoint "Display the receiver on aGraphicsContext translated by aPoint." | gc | icon == nil ifTrue: [^super displayOn: aGraphicsContext at: aPoint]. gc := aGraphicsContext copy. self setColorOn: gc. extent ~~ nil ifTrue: [gc intersectClip: (self bounds translatedBy: aPoint)]. mode even ifTrue: [icon displayOn: gc at: aPoint + self alignIconOffset. mode ~= 2 & item notNil ifTrue: [self image displayOn: gc at: aPoint + (self alignOffset: image)]] ifFalse: [item notNil ifTrue: [self image displayOn: gc at: aPoint + (self alignOffset: image)]. mode ~= 3 ifTrue: [icon displayOn: gc at: aPoint + self alignIconOffset]]
</methods> <methods> UI.BG_IconicLabel class <category>instance creation</category>
icon: anIcon item: anObject | label | label := super item: anObject. label icon: anIcon. ^label
item: anObject | label | label := super item: anObject. label mode: 3. ^label
item: anObject icon: anIcon | label | label := self icon: anIcon item: anObject. label mode: 1. ^label
</methods> <methods> UI.PieChartOptionsSpec <category>accessing</category>
dataLocation ^dataLocation isNil ifTrue: [#dataBelow] ifFalse: [dataLocation]
dataLocation: aValue dataLocation := aValue
doughnutLabel ^doughnutLabel
doughnutLabel: aValue doughnutLabel := aValue
explode ^explode
explode: aValue explode := aValue
lines ^self showLines ifTrue: [#show] ifFalse: [#hide]
lines: aValue self showLines: aValue = #show
shape shape isNil ifTrue: [^#circle]. ^shape
shape: aValue shape := aValue
showLines ^showLines == true
showLines: aValue showLines := aValue
sortSlices "Default is true" ^sortSlices ~= false
sortSlices: aValue sortSlices := aValue
</methods> <methods> UI.PieChartOptionsSpec <category>private-interface building</category>
insertIntoView: aChartView withBuilder: builder "Insert optional parameters into a pie chart view" shape isNil ifFalse: [shape == #circle ifTrue: [aChartView beCircle]. shape == #ellipse ifTrue: [aChartView beEllipse]]. doughnutLabel isNil ifFalse: [aChartView doughnutLabel: doughnutLabel]. explode isNil ifFalse: [| lbls | lbls := self getStringFrom: explode with: builder. lbls isNil ifFalse: [aChartView explode: lbls]]. dataLocation isNil ifFalse: [| sym | sym := dataLocation. sym == #hideData ifFalse: [self showLines ifTrue: [sym := (sym , #WithLine) asSymbol]]. aChartView perform: sym]. self sortSlices isNil ifFalse: [aChartView sortSlices: sortSlices].
</methods> <methods> UI.PieChartOptionsSpec class <category>private-interface building</category>
addBindingsTo: env for: inst channel: aChannel super addBindingsTo: env for: inst channel: aChannel. env at: #shape put: (self adapt: inst forAspect: #shape channel: aChannel). env at: #explode put: (self adapt: inst forAspect: #explode channel: aChannel). env at: #dLabel put: (self adapt: inst forAspect: #doughnutLabel channel: aChannel). env at: #dataLocation put: (self adapt: inst forAspect: #dataLocation channel: aChannel). env at: #lines put: (self adapt: inst forAspect: #lines channel: aChannel).
</methods> <methods> UI.PieChartOptionsSpec class <category>private</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> Tools.ChartColorTool <category>private</category>
changedColor colorValue value saturation = 0 ifTrue: [(builder componentAt: #hue) beInvisible. (builder componentAt: #hueLabel) beInvisible] ifFalse: [(builder componentAt: #hue) beVisible. (builder componentAt: #hueLabel) beVisible]. colorValue value brightness = 0.0 ifTrue: [(builder componentAt: #saturation) beInvisible. (builder componentAt: #saturationLabel) beInvisible] ifFalse: [(builder componentAt: #saturation) beVisible. (builder componentAt: #saturationLabel) beVisible].
changedCubesBrightness cubesBrightness value = 1 ifTrue: [^self]. cubeColors do: [:v | | c | c := v value. v value: (ColorValue hue: c hue saturation: c saturation brightness: 1.0 - cubesBrightness value)].
initChips "Set the background colors of the color chips to be some actual color (not nil) so that when showColors is initially called it will definitely print 'none' on those chips that wind up having null colors." #(#foregroundChip #backgroundChip #selectionForegroundChip #selectionBackgroundChip) do: [:chpname | (builder componentAt: chpname) getLookPreferences setBackgroundColor: Screen default defaultPaintPreferences backgroundColor]
setBGColorFrom: aColor | chip button | chip := builder componentAt: #backgroundChip. button := builder componentAt: #backgroundButton. lookPreferences setBackgroundColor: aColor. chip getLookPreferences setBackgroundColor: aColor. button labelString: (aColor isNil ifTrue: [(#none << #BGOK >> 'none')] ifFalse: [''])
setFGColorFrom: aColor | chip button | chip := builder componentAt: #foregroundChip. button := builder componentAt: #foregroundButton. lookPreferences setForegroundColor: aColor. chip getLookPreferences setBackgroundColor: aColor. button labelString: (aColor isNil ifTrue: [(#none << #BGOK >> 'none')] ifFalse: [''])
setUpVisuals | ext r c brightness lead x y sats v cp grays| (builder componentAt: #foregroundChip) setLookPreferences: LookPreferences new. (builder componentAt: #backgroundChip) setLookPreferences: LookPreferences new. self setFGColorFrom: lookPreferences foregroundColor. self setBGColorFrom: lookPreferences backgroundColor. (builder componentAt: #theActualColor) widget add: (ColoredArea model: colorValue) in: (0@0 corner: 1@1). cp := builder componentAt: #colorSpace. ext := 20. lead := 2. grays := #(1 0.94 0.86 0.8 0.7 0.6 0.43 0 ). "these values are gama corrected using ((i/7)**(1/2.3))and hand edited to overlap with the system" 0 to: 7 do: [:i | r := (0@((i)*ext)+ (lead@lead)) extent: ext@ext - (lead@lead). c := ValueHolder with: (ColorValue brightness: (grays at: i+1)). v := ColoredArea new. v controller: ColoredAreaController new. v model: colorValue. v select: c. cp widget add: v in: r]. cubeColors := OrderedCollection new. brightness := 1.0 - cubesBrightness value. sats := 8* brightness. y := 0. 1 to: sats do: [:s | |saturation | saturation := s asFloat / sats. x := 1. #(0 30 60 90 120 150 180 210 240 270 300 330) do: [:h | | hue | hue := h asFloat /360.0. r := ((x*ext)@(y*ext)+ (lead@lead) + (2@0)) extent: ext@ext - (lead@lead). c := ValueHolder with: (ColorValue hue: hue saturation: saturation brightness: brightness). v := ColoredArea new. v controller: ColoredAreaController new. v model: colorValue. v select: c. cubeColors add: c. cp widget add: v in: r. x := x + 1]. y := y + 1].
</methods> <methods> Tools.ChartColorTool <category>interface opening</category>
postBuildWith: aBuilder self setUpVisuals. (builder componentAt: #saturation) beInvisible. (builder componentAt: #saturationLabel) beInvisible. (builder componentAt: #hue) beInvisible. (builder componentAt: #hueLabel) beInvisible. builder window icon: (Icon constantNamed: #colorTool)
</methods> <methods> Tools.ChartColorTool <category>aspects</category>
brightness ^(PluggableAdaptor on: colorValue) getBlock: [:m | m value brightness] putBlock: [:m :v | m value: (ColorValue hue: m value hue saturation: m value saturation brightness: v). v = 0 ifTrue: [(self builder componentAt: #saturation) beInvisible. (self builder componentAt: #saturationLabel) beInvisible] ifFalse: [(self builder componentAt: #saturation) beVisible. (self builder componentAt: #saturationLabel) beVisible]] updateBlock: [:m :a :p | true]
hue ^(PluggableAdaptor on: colorValue) getBlock: [:m | m value hue] putBlock: [:m :v | m value: (ColorValue hue: v saturation: m value saturation brightness: m value brightness)] updateBlock: [:m :a :p | true].
saturation ^(PluggableAdaptor on: colorValue) getBlock: [:m | m value saturation] putBlock: [:m :v | m value: (ColorValue hue: m value hue saturation: v brightness: m value brightness)] updateBlock: [:m :a :p | true].
sliderModel ^cubesBrightness
</methods> <methods> Tools.ChartColorTool <category>accessing</category>
lookPreferences ^lookPreferences
lookPreferences: aValue lookPreferences := aValue
</methods> <methods> Tools.ChartColorTool <category>initialize-release</category>
initialize super initialize. lookPreferences := LookPreferences new. colorValue := ValueHolder with: ColorValue black. cubesBrightness := 0.0 asValue. colorValue onChangeSend: #changedColor to: self. cubesBrightness onChangeSend: #changedCubesBrightness to: self.
</methods> <methods> Tools.ChartColorTool <category>actions</category>
changeBGColor self setBGColorFrom: (lookPreferences backgroundColor == colorValue value ifTrue: [nil] ifFalse: [colorValue value])
changeFGColor self setFGColorFrom: (lookPreferences foregroundColor == colorValue value ifTrue: [nil] ifFalse: [colorValue value])
</methods> <methods> Tools.ChartColorTool class <category>private</category>
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> UI.ChartElementLookSpec class <category>resources</category>
lineStyleMenu "MenuEditor new openOnClass: self andSelector: #lineStyleMenu" <resource: #menu> ^#(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Default #defaultString: 'Default' #catalogID: #BGOK) #value: #default ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Solid #defaultString: 'Solid' #catalogID: #BGOK) #value: #solid ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Dotted #defaultString: 'Dotted' #catalogID: #BGOK) #value: #dotted ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Dashed #defaultString: 'Dashed' #catalogID: #BGOK) #value: #dashed ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Broken #defaultString: 'Broken' #catalogID: #BGOK) #value: #broken ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Dotted2 #defaultString: 'Dotted 2' #catalogID: #BGOK) #value: #dotted2 ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Dashed2 #defaultString: 'Dashed 2' #catalogID: #BGOK) #value: #dashed2 ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Broken2 #defaultString: 'Broken 2' #catalogID: #BGOK) #value: #broken2 ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #None #defaultString: 'None' #catalogID: #BGOK) #value: #none ) ) #(8 1 ) nil ) decodeAsLiteralArray
markerStyleMenu "MenuEditor new openOnClass: self andSelector: #markerStyleMenu" <resource: #menu> ^#(#{Menu} #( #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Default #defaultString: 'Default' #catalogID: #BGOK) #value: #default ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Square #defaultString: 'Square' #catalogID: #BGOK) #value: #square ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #SolidSquare #defaultString: 'Solid Square' #catalogID: #BGOK) #value: #solidSquare ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Circle #defaultString: 'Circle' #catalogID: #BGOK) #value: #circle ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #SolidCircle #defaultString: 'Solid Circle' #catalogID: #BGOK) #value: #solidCircle ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Triangle #defaultString: 'Triangle' #catalogID: #BGOK) #value: #triangle ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #SolidTriangle #defaultString: 'Solid Triangle' #catalogID: #BGOK) #value: #solidTrinagle ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Triangle2 #defaultString: 'Triangle 2' #catalogID: #BGOK) #value: #triangle2 ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #SolidTriangle2 #defaultString: 'Solid Triangle 2' #catalogID: #BGOK) #value: #solidTrinagle2 ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Diamond #defaultString: 'Diamond' #catalogID: #BGOK) #value: #diamond ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #SolidDiamond #defaultString: 'Solid Diamond' #catalogID: #BGOK) #value: #solidDiamond ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Cross #defaultString: 'Cross' #catalogID: #BGOK) #value: #cross ) #(#{MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #X #defaultString: 'X' #catalogID: #BGOK) #value: #x ) ) #(13 ) nil ) decodeAsLiteralArray
</methods> <methods> UI.ChartElementLookSpec class <category>interface specs</category>
lineLookSpec "UIPainter new openOnClass: self andSelector: #lineLookSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: '' #min: #(#Point 222 230 ) #max: #(#Point 640 235 ) #bounds: #(#Rectangle 660 125 902 355 ) ) #component: #(#SpecCollection #collection: #( #(#LabelSpec #layout: #(#AlignmentOrigin 0 0.5 9 0 0.5 0 ) #label: #(#{Kernel.UserMessage} #key: #DefineTheLookOfLines #defaultString: 'Define the look of lines:' #catalogID: #BGOK) ) #(#ActionButtonSpec #layout: #(#LayoutFrame -82 0.5 -35 1 -16 0.5 -5 1 ) #name: #okButton #model: #accept #label: #(#{Kernel.UserMessage} #key: #OK #defaultString: 'OK' #catalogID: #BGOK) #isDefault: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 16 0.5 -35 1 82 0.5 -5 1 ) #name: #cancelButton #model: #cancel #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #BGOK) #defaultable: true ) #(#MenuButtonSpec #layout: #(#LayoutFrame 73 0 58 0 -18 1 81 0 ) #model: #lineStyle #menu: #lineStyleMenu ) #(#LabelSpec #layout: #(#AlignmentOrigin 15 0 83 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Style #defaultString: 'Style:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 15 0 178 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Style #defaultString: 'Style:' #catalogID: #BGOK) ) #(#MenuButtonSpec #layout: #(#LayoutFrame 73 0 153 0 -18 1 176 0 ) #model: #markerStyle #menu: #markerStyleMenu ) #(#LabelSpec #layout: #(#AlignmentOrigin 15 0 115 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Width #defaultString: 'Width:' #catalogID: #BGOK) ) #(#InputFieldSpec #layout: #(#Rectangle 73 90 150 113 ) #model: #lineWidth #numChars: 3 #type: #number ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 32 0 -10 1 125 0 ) #label: #(#{Kernel.UserMessage} #key: #Line #defaultString: 'Line' #catalogID: #BGOK) ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 128 0 -10 1 189 0 ) #label: #(#{Kernel.UserMessage} #key: #Marker #defaultString: 'Marker' #catalogID: #BGOK) ) ) ) )
regionLookSpec "UIPainter new openOnClass: self andSelector: #regionLookSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #FillPattern #defaultString: 'Fill Pattern' #catalogID: #BGOK) #min: #(#Point 236 223 ) #max: #(#Point 236 223 ) #bounds: #(#Rectangle 401 277 637 500 ) ) #component: #(#SpecCollection #collection: #( #(#ActionButtonSpec #layout: #(#LayoutFrame 16 0 18 0 34 0 36 0 ) #model: #m1 #label: #i1 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 46 0 18 0 64 0 36 0 ) #model: #m2 #label: #i2 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 76 0 18 0 94 0 36 0 ) #model: #m3 #label: #i3 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 106 0 18 0 124 0 36 0 ) #model: #m4 #label: #i4 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 136 0 18 0 154 0 36 0 ) #model: #m5 #label: #i5 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 166 0 18 0 184 0 36 0 ) #model: #m6 #label: #i6 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 196 0 18 0 214 0 36 0 ) #model: #m7 #label: #i7 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 16 0 53 0 34 0 71 0 ) #model: #m8 #label: #i8 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 46 0 53 0 64 0 71 0 ) #model: #m9 #label: #i9 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 76 0 53 0 94 0 71 0 ) #model: #m10 #label: #i10 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 106 0 53 0 124 0 71 0 ) #model: #m11 #label: #i11 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 136 0 53 0 154 0 71 0 ) #model: #m12 #label: #i12 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 166 0 53 0 184 0 71 0 ) #model: #m13 #label: #i13 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 196 0 53 0 214 0 71 0 ) #model: #m14 #label: #i14 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 16 0 88 0 34 0 106 0 ) #model: #m16 #label: #i16 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 46 0 88 0 64 0 106 0 ) #model: #m17 #label: #i17 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 76 0 88 0 94 0 106 0 ) #model: #m18 #label: #i18 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 106 0 88 0 124 0 106 0 ) #model: #m19 #label: #i19 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 136 0 88 0 154 0 106 0 ) #model: #m20 #label: #i20 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 166 0 88 0 184 0 106 0 ) #model: #m21 #label: #i21 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 196 0 88 0 214 0 106 0 ) #model: #m15 #label: #i15 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 16 0 123 0 34 0 141 0 ) #model: #m29 #label: #i29 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 46 0 123 0 64 0 141 0 ) #model: #m30 #label: #i30 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 76 0 123 0 94 0 141 0 ) #model: #m31 #label: #i31 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 106 0 123 0 124 0 141 0 ) #model: #m32 #label: #i32 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 136 0 123 0 154 0 141 0 ) #model: #m33 #label: #i33 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 166 0 123 0 184 0 141 0 ) #model: #m34 #label: #i34 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 196 0 123 0 214 0 141 0 ) #model: #m35 #label: #i35 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 16 0 158 0 34 0 176 0 ) #model: #m22 #label: #i22 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 46 0 158 0 64 0 176 0 ) #model: #m23 #label: #i23 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 76 0 158 0 94 0 176 0 ) #model: #m24 #label: #i24 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 106 0 158 0 124 0 176 0 ) #model: #m25 #label: #i25 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 136 0 158 0 154 0 176 0 ) #model: #m26 #label: #i26 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 166 0 158 0 184 0 176 0 ) #model: #m27 #label: #i27 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 196 0 158 0 214 0 176 0 ) #model: #m28 #label: #i28 #hasCharacterOrientedLabel: false #defaultable: true ) #(#ActionButtonSpec #layout: #(#Rectangle 83 187 149 217 ) #name: #cancelButton #model: #cancel #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #BGOK) #defaultable: true ) ) ) )
</methods> <methods> Examples.BG_Chart1 class <category>windowSpec</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #SimpleChart #defaultString: 'Simple Chart' #catalogID: #BGOK) #bounds: #(#Rectangle 501 132 866 509 ) ) #component: #(#SpecCollection #collection: #( #(#ChartViewSpec #layout: #(#Rectangle 20 20 345 337 ) #model: #data #options: #(#BarChartOptionsSpec #width: 0.6 ) ) #(#ActionButtonSpec #layout: #(#Rectangle 147 342 219 372 ) #model: #update #label: #(#{Kernel.UserMessage} #key: #Update #defaultString: 'Update' #catalogID: #BGOK) #isDefault: true #defaultable: true ) ) ) )
</methods> <methods> Examples.BG_EzChart class <category>windowSpec2</category>
windowSpec2 "Tools.UIPainter new openOnClass: self andSelector: #windowSpec2" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #EasyChart2 #defaultString: 'Easy Chart 2' #catalogID: #BGOK ) #min: #(#{Core.Point} 20 20 ) #bounds: #(#{Graphics.Rectangle} 800 600 1065 791 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.ChartViewSpec} #layout: #(#{Graphics.LayoutFrame} 5 0 5 0 -5 1 -5 1 ) #model: #data2 #dataSeries: #(#{UI.ChartDataSpec} #series: #( #(#{UI.ChartDataSetSpec} #name: 'Data1' ) #(#{UI.ChartDataSetSpec} #name: 'Data2' ) #(#{UI.ChartDataSetSpec} #isData: false #name: 'Labels' ) ) ) ) ) ) )
</methods> <methods> Examples.BG_EzChart class <category>windowSpec</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #EasyChart1 #defaultString: 'Easy Chart 1' #catalogID: #BGOK) #min: #(#Point 20 20 ) #bounds: #(#Rectangle 217 233 482 424 ) ) #component: #(#SpecCollection #collection: #( #(#ChartViewSpec #layout: #(#LayoutFrame 5 0 5 0 -5 1 -5 1 ) #model: #data ) ) ) )
</methods> <methods> UI.BarChartOptionsSpec class <category>interface specs</category>
defaultDialogSpec "UIPainter new openOnClass: self andSelector: #defaultDialogSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: '' #min: #(#Point 20 20 ) #bounds: #(#Rectangle 82 274 344 640 ) ) #component: #(#SpecCollection #collection: #( #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 72 0 -10 1 177 0 ) #label: #(#{Kernel.UserMessage} #key: #DataLocation #defaultString: 'Data Location:' #catalogID: #BGOK) ) #(#RadioButtonSpec #layout: #(#Point 21 94 ) #model: #dataLocation #label: #(#{Kernel.UserMessage} #key: #None #defaultString: 'None' #catalogID: #BGOK) #select: #none ) #(#RadioButtonSpec #layout: #(#Point 21 121 ) #model: #dataLocation #label: #(#{Kernel.UserMessage} #key: #Inside #defaultString: 'Inside' #catalogID: #BGOK) #select: #inside ) #(#RadioButtonSpec #layout: #(#Point 21 148 ) #model: #dataLocation #label: #(#{Kernel.UserMessage} #key: #Outside #defaultString: 'Outside' #catalogID: #BGOK) #select: #outside ) #(#CheckBoxSpec #layout: #(#Point 10 184 ) #name: #linkLine #model: #showLink #label: #(#{Kernel.UserMessage} #key: #LinkLine #defaultString: 'Link Line' #catalogID: #BGOK) ) #(#InputFieldSpec #layout: #(#LayoutFrame 90 0 237 0 -16 1 262 0 ) #model: #picture #menu: #fieldMenu #type: #symbol ) #(#InputFieldSpec #layout: #(#LayoutFrame 90 0 272 0 -16 1 297 0 ) #model: #unit #menu: #fieldMenu #type: #number ) #(#LabelSpec #layout: #(#Point 10 11 ) #label: #(#{Kernel.UserMessage} #key: #BarWidth #defaultString: 'Bar Width:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#Point 10 40 ) #label: #(#{Kernel.UserMessage} #key: #BarOverlap #defaultString: 'Bar Overlap:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 18 0 263 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Aspect #defaultString: 'Aspect:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 19 0 298 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Unit #defaultString: 'Unit:' #catalogID: #BGOK) ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 211 0 -10 1 308 0 ) #label: #(#{Kernel.UserMessage} #key: #PictureC #defaultString: 'Picture:' #catalogID: #BGOK) ) #(#SliderSpec #layout: #(#LayoutFrame 120 0 10 0 -10 1 33 0 ) #model: #barWidth #orientation: #horizontal #start: 0.2 #stop: 1 #step: 0.1 ) #(#SliderSpec #layout: #(#LayoutFrame 120 0 40 0 -10 1 63 0 ) #model: #barOverlap #orientation: #horizontal #start: -1 #stop: 1 #step: 0.2 ) ) ) )
</methods> <methods> UI.ChartViewSpec class <category>resources</category>
chartTypeMenu "UIMenuEditor new openOnClass: self andSelector: #chartTypeMenu" <resource: #menu> ^#(#PopUpMenu #(#(#{Kernel.UserMessage} #key: #Bar #defaultString: 'Bar' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Pareto #defaultString: 'Pareto' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Picture #defaultString: 'Picture' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #StackedBar #defaultString: 'StackedBar' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Band #defaultString: 'Band' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Layer #defaultString: 'Layer' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Line #defaultString: 'Line' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #StackedLine #defaultString: 'StackedLine' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Step #defaultString: 'Step' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #XY #defaultString: 'XY' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Pie #defaultString: 'Pie' #catalogID: #BGOK) ) #(6 10 ) #(#BG_BarChartView #BG_ParatoChartView #BG_PictureChartView #BG_StackedBarChartView #BG_BandChartView #BG_LayerChartView #BG_LineChartView #BG_StackedLineChartView #BG_StepChartView #BG_XYChartView #BG_PieChartView ) ) decodeAsLiteralArray
paletteIcon "UIMaskEditor new openOnClass: self andSelector: #paletteIcon" <resource: #image> ^CachedImage on: (Image extent: 26@26 depth: 3 bitsPerPixel: 4 palette: (MappedPalette withColors: ((Array new: 8) at: 1 put: ColorValue black; at: 2 put: (ColorValue scaledRed: 6553 scaledGreen: 6553 scaledBlue: 6553); at: 3 put: (ColorValue scaledRed: 3822 scaledGreen: 3822 scaledBlue: 3822); at: 4 put: ColorValue white; at: 5 put: (ColorValue scaledRed: 7645 scaledGreen: 0 scaledBlue: 0); at: 6 put: (ColorValue scaledRed: 0 scaledGreen: 0 scaledBlue: 3822); at: 7 put: (ColorValue scaledRed: 0 scaledGreen: 3822 scaledBlue: 0); at: 8 put: ColorValue blue; yourself)) usingBits: (ByteArray fromPackedString: '@@@@@@@@@@@@@@@@@@@@@@L3L3L3L3L3L3L3L2@@@@@CDQDQDQDQDQDQDQD @@@@@1DQDQDQDQDQDQDQH@@@@@LP@@@@@@@@@@@@@R@@@@@CDCL3L3L3L3L3L0D @@@@@1@3L3L3L5M#P7LAH@@@@@LPL3L3L3L@@@@C@R@@@@@CDCL3L3L3L3L3L0D @@@@@1@CUUL3L3L3L3LAH@@@@@LPL5USL3L3L3L3@R@@@@@CDCMUT3L3L3M7\0D @@@@@1@3UUL3L3L3]7LAH@@@@@LP@5USY&L3L7]3@R@@@@@CDCMUT6Y#L3M7\0D @@@@@1@3UUM&X3L3]7LAH@@@@@LPL5USY&L3L7]3@R@@@@@CD@MUT6Y#QDM7\0D @@@@@1@3UUM&X4QC]7LAH@@@@@LPL5USY&MDP7]3@R@@@@@CDCMUT6Y#QDM7\0D @@@@@1@3UUM&X4QC]7LAH@@@@@LP@@@@@@@@@@@@@R@@@@@CDQDQDQDQDQDQDQD @@@@@"H"H"H"H"H"H"H"H@@@@@@@@@@@@@@@@@@@@@@@@@@b'))
paletteMonoIcon "UIMaskEditor new openOnClass: self andSelector: #paletteMonoIcon" <resource: #image> ^(Image extent: 26@26 depth: 1 bitsPerPixel: 1 palette: CoveragePalette monoMaskPalette usingBits: #[255 255 255 192 128 0 0 192 128 0 0 192 159 255 254 192 144 0 2 192 144 2 170 192 144 3 250 192 144 0 2 192 155 128 2 192 147 128 2 192 147 128 58 192 147 128 58 192 155 184 58 192 147 184 58 192 147 184 58 192 147 184 58 192 155 187 186 192 147 187 186 192 147 187 186 192 147 187 186 192 147 187 186 192 159 255 254 192 128 0 0 192 128 0 0 192 255 255 255 192 255 255 255 192 ])
</methods> <methods> UI.ChartViewSpec class <category>interface specs</category>
defaultDialogSpec "UIPainter new openOnClass: self andSelector: #defaultDialogSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #UnlabeledCanvas #defaultString: 'Unlabeled Canvas' #catalogID: #BGOK) #min: #(#Point 20 20 ) #bounds: #(#Rectangle 98 185 345 516 ) ) #component: #(#SpecCollection #collection: #( #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 54 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Aspect #defaultString: 'Aspect:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 85 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #ID #defaultString: 'ID:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 115 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Type #defaultString: 'Type:' #catalogID: #BGOK) ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 123 0 -10 1 179 0 ) #label: #(#{Kernel.UserMessage} #key: #Orientation #defaultString: 'Orientation' #catalogID: #BGOK) ) #(#InputFieldSpec #layout: #(#LayoutFrame 86 0 28 0 -10 1 53 0 ) #model: #model #menu: #fieldMenu ) #(#InputFieldSpec #layout: #(#LayoutFrame 86 0 59 0 -10 1 84 0 ) #model: #name #menu: #fieldMenu ) #(#MenuButtonSpec #layout: #(#Rectangle 86 90 220 114 ) #model: #setChartType #menu: #chartTypeMenu ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 18 0 170 0 0 1 ) #model: #orientation #label: #(#{Kernel.UserMessage} #key: #Vertical #defaultString: 'Vertical' #catalogID: #BGOK) #select: #vertical ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 110 0 170 0 0 1 ) #model: #orientation #label: #(#{Kernel.UserMessage} #key: #Horizontal #defaultString: 'Horizontal' #catalogID: #BGOK) #select: #horizontal ) ) ) )
legendDialogSpec "UIPainter new openOnClass: self andSelector: #legendDialogSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: '' #min: #(#Point 20 20 ) #bounds: #(#Rectangle 97 278 354 576 ) ) #component: #(#SpecCollection #collection: #( #(#GroupBoxSpec #layout: #(#LayoutFrame 14 0 7 0 130 0 143 0 ) #label: #(#{Kernel.UserMessage} #key: #Position #defaultString: 'Position' #catalogID: #BGOK) ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 139 0 41 0 0 0.5 ) #model: #position #label: #(#{Kernel.UserMessage} #key: #Hidden #defaultString: 'Hidden' #catalogID: #BGOK) #select: 0 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 39 0 32 0 ) #model: #position #select: 1 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 60 0 32 0 ) #model: #position #select: 2 ) #(#RadioButtonSpec #layout: #(#Rectangle 82 32 105 50 ) #model: #position #select: 3 ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 44 0 56 0 1 0 ) #model: #position #select: 4 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 60 0 56 0 ) #model: #position #select: 5 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 103 0 56 0 ) #model: #position #select: 6 ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 44 0 74 0 1 0 ) #model: #position #select: 7 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 60 0 74 0 ) #model: #position #select: 8 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 103 0 74 0 ) #model: #position #select: 9 ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 44 0 93 0 1 0 ) #model: #position #select: 10 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 60 0 93 0 ) #model: #position #select: 11 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 103 0 93 0 ) #model: #position #select: 12 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 39 0 117 0 ) #model: #position #select: 13 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 60 0 117 0 ) #model: #position #select: 14 ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 82 0 117 0 ) #model: #position #select: 15 ) #(#GroupBoxSpec #layout: #(#LayoutFrame 44 0 53 0 99 0 113 0 ) ) ) ) )
</methods> <methods> Examples.BG_StockTool class <category>windowSpec</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{FullSpec} #window: #(#{WindowSpec} #label: #(#{Kernel.UserMessage} #key: #Stocks #defaultString: 'Stocks' #catalogID: #BGOK) #min: #(#{Point} 20 20 ) #bounds: #(#{Rectangle} 297 271 937 546 ) #flags: 4 #menu: #menuBar ) #component: #(#{SpecCollection} #collection: #( #(#{SequenceViewSpec} #layout: #(#{LayoutFrame} 10 0 10 0 152 0 -10 1 ) #model: #stockNames #multipleSelections: false ) #(#{ChartViewSpec} #layout: #(#{LayoutFrame} 172 0 10 0 -10 1 -10 1 ) #name: #stocks #model: #data #chartType: #BG_LineChartView #dataSeries: #(#{ChartDataSpec} #series: #( #(#{ChartDataSetSpec} #aspect: #price #name: 'Stock1' ) #(#{ChartDataSetSpec} #aspect: #labels #isData: false #name: 'Labels' #isComputed: true ) ) ) #xAxis: #(#{ChartingAxisSpec} #scale: #(#{ChartingScaleSpec} #step: 5 #restrictions: #(#auto #zero #div #log ) ) #tickPosition: #hideTick #sectionMarkAt: #divisionMarks ) #yAxis: #(#{ChartingValueAxisSpec} #scale: #(#{ChartingScaleSpec} #invert: true ) #unit: '$' ) #legendPosition: 3 ) ) ) )
</methods> <methods> Examples.BG_StockTool class <category>menuBar</category>
menuBar "UIMenuEditor new openOnClass: self andSelector: #menuBar" <resource: #menu> ^#(#Menu #(#(#MenuItem #rawLabel: #(#{Kernel.UserMessage} #key: #File #defaultString: 'File' #catalogID: #BGOK) #submenu: #(#Menu #(#(#MenuItem #rawLabel: #(#{Kernel.UserMessage} #key: #LoadExampleData #defaultString: 'Load example data' #catalogID: #BGOK) ) ) #(1 ) #(#loadQuotes ) ) ) ) #(1 ) #(nil ) ) decodeAsLiteralArray
</methods> <methods> Examples.BG_Sales class <category>windowSpec</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #SalesByPlatform #defaultString: 'Sales by Platform' #catalogID: #BGOK) #bounds: #(#Rectangle 310 277 593 482 ) ) #component: #(#SpecCollection #collection: #( #(#ChartViewSpec #layout: #(#LayoutFrame 2 0 2 0 -10 1 -2 1 ) #model: #sales #chartType: #BG_LineChartView #dataSeries: #(#ChartDataSpec #series: #( #(#ChartDataSetSpec #aspect: #salesWin #name: 'Windows' #look: #(#ChartElementLookSpec #lineWidth: 3 ) ) #(#ChartDataSetSpec #aspect: #salesMac #name: 'Mac' #look: #(#ChartElementLookSpec #lineWidth: 3 ) ) #(#ChartDataSetSpec #aspect: #month #isData: false #name: 'Month' ) ) ) #xAxis: #(#ChartingAxisSpec #sectionMarkAt: #divisionMarks ) #yAxis: #(#ChartingValueAxisSpec #scale: #(#ChartingScaleSpec #invert: true ) #unit: 'Boxes' ) #legendPosition: 3 ) ) ) )
</methods> <methods> UI.ChartingAxisSpec class <category>resources</category>
labelPositionMenuSpec "UIMenuEditor new openOnClass: self andSelector: #labelPositionMenuSpec" <resource: #menu> ^#(#PopUpMenu #(#(#{Kernel.UserMessage} #key: #None #defaultString: 'None' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Major #defaultString: 'Major' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Division #defaultString: 'Division' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Edge #defaultString: 'Edge' #catalogID: #BGOK) ) #() #(#none #majorMarks #divisionMarks #edgeMarks ) ) decodeAsLiteralArray
tickPositionMenuSpec "UIMenuEditor new openOnClass: self andSelector: #tickPositionmenuSpec" <resource: #menu> ^#(#PopUpMenu #(#(#{Kernel.UserMessage} #key: #Hide #defaultString: 'Hide' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Cross #defaultString: 'Cross' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Inside #defaultString: 'Inside' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Outside #defaultString: 'Outside' #catalogID: #BGOK) ) #() #(#hideTick #tickCross #tickInside #tickOutside ) ) decodeAsLiteralArray
</methods> <methods> UI.ChartingAxisSpec class <category>interface specs</category>
defaultDialogSpec "UIPainter new openOnClass: self andSelector: #defaultDialogSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: '' #min: #(#Point 20 20 ) #bounds: #(#Rectangle 148 283 404 668 ) ) #component: #(#SpecCollection #collection: #( #(#InputFieldSpec #layout: #(#LayoutFrame 86 0 13 0 -10 1 38 0 ) #model: #title #menu: #fieldMenu ) #(#InputFieldSpec #layout: #(#LayoutFrame 86 0 45 0 -10 1 70 0 ) #model: #unit #menu: #fieldMenu ) #(#MenuButtonSpec #layout: #(#Rectangle 90 102 224 126 ) #model: #sectionMarks #menu: #sectionMarksMenu ) #(#CheckBoxSpec #layout: #(#Point 20 162 ) #model: #borderLine #label: #(#{Kernel.UserMessage} #key: #Border #defaultString: 'Border' #catalogID: #BGOK) ) #(#CheckBoxSpec #layout: #(#Point 105 162 ) #model: #axisLine #label: #(#{Kernel.UserMessage} #key: #Axis #defaultString: 'Axis' #catalogID: #BGOK) ) #(#MenuButtonSpec #layout: #(#Rectangle 90 131 224 155 ) #model: #tickPosition #menu: #tickPositionMenu ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 38 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Title #defaultString: 'Title:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 72 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Unit #defaultString: 'Unit:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 15 0 156 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Ticks #defaultString: 'Ticks:' #catalogID: #BGOK) ) #(#GroupBoxSpec #layout: #(#LayoutFrame 8 0 75 0 -10 1 192 0 ) #label: #(#{Kernel.UserMessage} #key: #LinesC #defaultString: 'Lines:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 15 0 127 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Section #defaultString: 'Section:' #catalogID: #BGOK) ) ) ) )
</methods> <methods> Tools.ChartScaleSpecModel class <category>interface specs</category>
defaultPropertySpec "UIPainter new openOnClass: self andSelector: #defaultPropertySpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: '' #min: #(#Point 20 20 ) #bounds: #(#Rectangle 61 203 318 501 ) ) #component: #(#SpecCollection #collection: #( #(#CheckBoxSpec #layout: #(#Point 10 30 ) #name: #autoScaleBox #model: #autoScale #label: #(#{Kernel.UserMessage} #key: #AutoScale #defaultString: 'Auto Scale' #catalogID: #BGOK) ) #(#CheckBoxSpec #layout: #(#Point 10 55 ) #model: #invert #label: #(#{Kernel.UserMessage} #key: #InvertScale #defaultString: 'Invert Scale' #catalogID: #BGOK) ) #(#InputFieldSpec #layout: #(#Rectangle 62 95 112 120 ) #name: #zeroField #model: #zero #menu: #fieldMenu #type: #number ) #(#InputFieldSpec #layout: #(#Rectangle 181 95 231 120 ) #name: #divField #model: #minorDivisions #menu: #fieldMenu #type: #number ) #(#InputFieldSpec #layout: #(#Rectangle 62 128 112 153 ) #name: #minField #model: #min #menu: #fieldMenu #type: #number ) #(#InputFieldSpec #layout: #(#Rectangle 181 128 231 153 ) #name: #maxField #model: #max #menu: #fieldMenu #type: #number ) #(#InputFieldSpec #layout: #(#Rectangle 62 161 112 186 ) #name: #stepField #model: #step #menu: #fieldMenu #type: #number ) #(#RadioButtonSpec #layout: #(#Point 21 219 ) #name: #scaleNormal #model: #scaleType #label: #(#{Kernel.UserMessage} #key: #Normal #defaultString: 'Normal' #catalogID: #BGOK) #select: #normal ) #(#RadioButtonSpec #layout: #(#Point 21 243 ) #name: #scaleLog #model: #scaleType #label: #(#{Kernel.UserMessage} #key: #Log #defaultString: 'Log' #catalogID: #BGOK) #select: #log ) #(#InputFieldSpec #layout: #(#Rectangle 181 241 231 266 ) #name: #baseField #model: #base #menu: #fieldMenu #type: #number ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 154 0 0 1 ) #name: #minLabel #label: #(#{Kernel.UserMessage} #key: #Min #defaultString: 'Min:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 132 0 154 0 0 1 ) #name: #maxLabel #label: #(#{Kernel.UserMessage} #key: #Max #defaultString: 'Max:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 121 0 0 1 ) #name: #zeroLabel #label: #(#{Kernel.UserMessage} #key: #ZeroC #defaultString: 'Zero:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 186 0 0 1 ) #name: #stepLabel #label: #(#{Kernel.UserMessage} #key: #StepC #defaultString: 'Step:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 132 0 121 0 0 1 ) #name: #divLabel #label: #(#{Kernel.UserMessage} #key: #Div #defaultString: 'Div:' #catalogID: #BGOK) ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 195 0 -10 1 276 0 ) #label: #(#{Kernel.UserMessage} #key: #ScaleType #defaultString: 'Scale Type:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 132 0 267 0 0 1 ) #name: #baseLabel #label: #(#{Kernel.UserMessage} #key: #Base #defaultString: 'Base:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 0 0.5 4 0 0.5 0 ) #label: #(#{Kernel.UserMessage} #key: #Scale #defaultString: 'Scale' #catalogID: #BGOK) ) ) ) )
</methods> <methods> Tools.ChartDataSpecModel class <category>interface specs</category>
defaultPropertySpec "UIPainter new openOnClass: self andSelector: #defaultPropertySpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: '' #min: #(#Point 20 20 ) #bounds: #(#Rectangle 562 343 889 729 ) ) #component: #(#SpecCollection #collection: #( #(#LabelSpec #layout: #(#Point 10 13 ) #label: #(#{Kernel.UserMessage} #key: #DataSet #defaultString: 'Data Set:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 17 0 147 0 0 1 ) #name: #nameLabel #label: #(#{Kernel.UserMessage} #key: #Name #defaultString: 'Name:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 17 0 176 0 0 1 ) #name: #aspectLabel #label: #(#{Kernel.UserMessage} #key: #Aspect #defaultString: 'Aspect:' #catalogID: #BGOK) ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 95 0 -10 1 283 0 ) #label: #(#{Kernel.UserMessage} #key: #Attributes #defaultString: 'Attributes:' #catalogID: #BGOK) ) #(#ActionButtonSpec #layout: #(#LayoutFrame -82 0.5 51 0 -16 0.5 81 0 ) #name: #newSeriesButton #model: #newSeries #label: #(#{Kernel.UserMessage} #key: #New #defaultString: 'New' #catalogID: #BGOK) #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 16 0.5 51 0 82 0.5 81 0 ) #name: #deleteButton #model: #deleteSeries #label: #(#{Kernel.UserMessage} #key: #Delete #defaultString: 'Delete' #catalogID: #BGOK) #defaultable: true ) #(#InputFieldSpec #layout: #(#LayoutFrame 90 0 121 0 -16 1 146 0 ) #name: #nameField #flags: 40 #model: #seriesName #callbacksSpec: #(#UIEventCallbackSubSpec #valueChangeSelector: #redefinedName ) #menu: #fieldMenu ) #(#InputFieldSpec #layout: #(#LayoutFrame 90 0 150 0 -16 1 175 0 ) #name: #aspectField #flags: 40 #model: #seriesAspect #callbacksSpec: #(#UIEventCallbackSubSpec #valueChangeSelector: #redefinedAspect ) #menu: #fieldMenu #type: #symbol ) #(#CheckBoxSpec #layout: #(#Point 17 182 ) #name: #labelCheckBox #model: #isLabel #label: #(#{Kernel.UserMessage} #key: #Label #defaultString: 'Label' #catalogID: #BGOK) ) #(#CheckBoxSpec #layout: #(#Point 17 207 ) #name: #computedCheckBox #model: #isComputed #label: #(#{Kernel.UserMessage} #key: #Computed #defaultString: 'Computed' #catalogID: #BGOK) ) #(#ActionButtonSpec #layout: #(#LayoutFrame 20 0 242 0 -2 0.33 272 0 ) #name: #colorToolButton #model: #colorTool #label: #(#{Kernel.UserMessage} #key: #Color #defaultString: 'Color...' #catalogID: #BGOK) #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame 2 0.33 242 0 -18 0.67 272 0 ) #name: #lineLookToolButton #model: #lineLookTool #label: #(#{Kernel.UserMessage} #key: #LinesDot #defaultString: 'Lines...' #catalogID: #BGOK) #defaultable: true ) #(#ActionButtonSpec #layout: #(#LayoutFrame -14 0.67 242 0 -20 1 272 0 ) #name: #regionLookToolButton #model: #regionLookTool #label: #(#{Kernel.UserMessage} #key: #Patterns #defaultString: 'Patterns...' #catalogID: #BGOK) #defaultable: true ) #(#MenuButtonSpec #layout: #(#LayoutFrame 93 0 13 0 -10 1 36 0 ) #name: #dataSeriesMenuButton #model: #dataSeries #menu: #dataSeriesMenu ) ) ) )
</methods> <methods> Examples.BG_Company class <category>windowSpec</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #Employees #defaultString: 'Employees' #catalogID: #BGOK) #bounds: #(#Rectangle 306 282 621 533 ) ) #component: #(#SpecCollection #collection: #( #(#ChartViewSpec #layout: #(#LayoutFrame 13 0 4 0 -5 1 -6 1 ) #model: #employees #chartType: #BG_LineChartView #orientation: #vertical #dataSeries: #(#ChartDataSpec #series: #( #(#ChartDataSetSpec #aspect: #salary #name: 'Salary' #look: #(#ChartElementLookSpec #lineWidth: 3 ) ) #(#ChartDataSetSpec #aspect: #name #isData: false #name: 'Name' ) #(#ChartDataSetSpec #aspect: #age #name: 'Age' #look: #(#ChartElementLookSpec #foregroundColor: #(#ColorValue #blue ) #backgroundColor: #(#ColorValue #blue ) #lineType: #dashed #lineWidth: 3 ) ) ) ) #xAxis: #(#ChartingAxisSpec #sectionMarkAt: #divisionMarks ) #yAxis: #(#ChartingValueAxisSpec #scale: #(#ChartingScaleSpec #invert: true ) ) #legendPosition: 6 ) ) ) )
</methods> <methods> UI.LineChartOptionsSpec class <category>interface specs</category>
defaultDialogSpec "UIPainter new openOnClass: self andSelector: #defaultDialogSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: '' #min: #(#Point 20 20 ) #bounds: #(#Rectangle 98 272 355 570 ) ) #component: #(#SpecCollection #collection: #( #(#RadioButtonSpec #layout: #(#AlignmentOrigin 87 0 196 0 0 1 ) #model: #dataLocation #label: #(#{Kernel.UserMessage} #key: #Hide #defaultString: 'Hide' #catalogID: #BGOK) #select: #none ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 14 0 196 0 0 1 ) #model: #dataLocation #label: #(#{Kernel.UserMessage} #key: #Show #defaultString: 'Show' #catalogID: #BGOK) #select: #inside ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 149 0 -10 1 200 0 ) #label: #(#{Kernel.UserMessage} #key: #Data #defaultString: 'Data:' #catalogID: #BGOK) ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 16 0 -10 1 92 0 ) #label: #(#{Kernel.UserMessage} #key: #LineC #defaultString: 'Line:' #catalogID: #BGOK) ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 87 0 63 0 0 1 ) #model: #lineLocation #label: #(#{Kernel.UserMessage} #key: #Hide #defaultString: 'Hide' #catalogID: #BGOK) #select: #hide ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 95 0 -10 1 146 0 ) #label: #(#{Kernel.UserMessage} #key: #MarkerC #defaultString: 'Marker:' #catalogID: #BGOK) ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 87 0 142 0 0 1 ) #model: #markerLocation #label: #(#{Kernel.UserMessage} #key: #Hide #defaultString: 'Hide' #catalogID: #BGOK) #select: #hide ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 14 0 63 0 0 1 ) #model: #lineLocation #label: #(#{Kernel.UserMessage} #key: #Show #defaultString: 'Show' #catalogID: #BGOK) #select: #show ) #(#CheckBoxSpec #layout: #(#AlignmentOrigin 15 0 88 0 0 1 ) #model: #showSpline #label: #(#{Kernel.UserMessage} #key: #Spline #defaultString: 'Spline' #catalogID: #BGOK) ) #(#RadioButtonSpec #layout: #(#AlignmentOrigin 14 0 142 0 0 1 ) #model: #markerLocation #label: #(#{Kernel.UserMessage} #key: #Show #defaultString: 'Show' #catalogID: #BGOK) #select: #show ) ) ) )
</methods> <methods> UI.ChartingValueAxisSpec class <category>resources</category>
labelFormatMenuSpec "UIMenuEditor new openOnClass: self andSelector: #labelFormatMenuSpec" <resource: #menu> ^#(#PopUpMenu #(#(#{Kernel.UserMessage} #key: #General #defaultString: 'General' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Comma #defaultString: 'Comma' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Float #defaultString: 'Float' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Percent #defaultString: 'Percent' #catalogID: #BGOK) ) #() #(#general #comma #float #percent ) ) decodeAsLiteralArray
labelPositionMenuSpec "UIMenuEditor new openOnClass: self andSelector: #labelPositionMenuSpec" <resource: #menu> ^#(#PopUpMenu #(#(#{Kernel.UserMessage} #key: #None #defaultString: 'None' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Major #defaultString: 'Major' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Minor #defaultString: 'Minor' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Division #defaultString: 'Division' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Edge #defaultString: 'Edge' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Zero #defaultString: 'Zero' #catalogID: #BGOK) ) #() #(#none #majorMarks #minorMarks #divisionMarks #edgeMarks #zeroMarks ) ) decodeAsLiteralArray
</methods> <methods> UI.ChartingValueAxisSpec class <category>interface specs</category>
defaultDialogSpec "UIPainter new openOnClass: self andSelector: #defaultDialogSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: '' #min: #(#Point 20 20 ) #bounds: #(#Rectangle 79 260 335 645 ) ) #component: #(#SpecCollection #collection: #( #(#GroupBoxSpec #layout: #(#LayoutFrame 8 0 200 0 -10 1 295 0 ) #label: #(#{Kernel.UserMessage} #key: #Labels #defaultString: 'Labels' #catalogID: #BGOK) ) #(#InputFieldSpec #layout: #(#LayoutFrame 86 0 11 0 -10 1 36 0 ) #model: #title #menu: #fieldMenu ) #(#InputFieldSpec #layout: #(#LayoutFrame 86 0 41 0 -10 1 66 0 ) #model: #unit #menu: #fieldMenu ) #(#MenuButtonSpec #layout: #(#Rectangle 90 102 224 126 ) #model: #sectionMarks #menu: #sectionMarksMenu ) #(#CheckBoxSpec #layout: #(#LayoutOrigin 20 0 162 0 ) #model: #borderLine #label: #(#{Kernel.UserMessage} #key: #Border #defaultString: 'Border' #catalogID: #BGOK) ) #(#CheckBoxSpec #layout: #(#LayoutOrigin 105 0 162 0 ) #model: #axisLine #label: #(#{Kernel.UserMessage} #key: #Axis #defaultString: 'Axis' #catalogID: #BGOK) ) #(#MenuButtonSpec #layout: #(#Rectangle 90 131 224 155 ) #model: #tickPosition #menu: #tickPositionMenu ) #(#MenuButtonSpec #layout: #(#Rectangle 90 225 224 249 ) #model: #labelFormat #menu: #labelFormatMenu ) #(#MenuButtonSpec #layout: #(#Rectangle 90 255 224 279 ) #model: #labelPosition #menu: #labelPositionMenu ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 36 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Title #defaultString: 'Title:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 67 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Unit #defaultString: 'Unit:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 15 0 155 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Ticks #defaultString: 'Ticks:' #catalogID: #BGOK) ) #(#GroupBoxSpec #layout: #(#LayoutFrame 8 0 75 0 -10 1 192 0 ) #label: #(#{Kernel.UserMessage} #key: #LinesC #defaultString: 'Lines:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 15 0 127 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Section #defaultString: 'Section:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 15 0 250 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #Format #defaultString: 'Format:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 15 0 280 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #PositionC #defaultString: 'Position:' #catalogID: #BGOK) ) ) ) )
</methods> <methods> UI.PieChartOptionsSpec class <category>interface specs</category>
defaultDialogSpec "UIPainter new openOnClass: self andSelector: #defaultDialogSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: '' #min: #(#Point 20 20 ) #bounds: #(#Rectangle 103 351 360 649 ) ) #component: #(#SpecCollection #collection: #( #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 107 0 -10 1 207 0 ) #label: #(#{Kernel.UserMessage} #key: #Data #defaultString: 'Data:' #catalogID: #BGOK) ) #(#GroupBoxSpec #layout: #(#LayoutFrame 10 0 210 0 -4 0.5 290 0 ) #label: #(#{Kernel.UserMessage} #key: #Shape #defaultString: 'Shape:' #catalogID: #BGOK) ) #(#GroupBoxSpec #layout: #(#LayoutFrame 4 0.5 210 0 -10 1 290 0 ) #label: #(#{Kernel.UserMessage} #key: #LinesC #defaultString: 'Lines:' #catalogID: #BGOK) ) #(#RadioButtonSpec #layout: #(#Point 24 128 ) #model: #dataLocation #label: #(#{Kernel.UserMessage} #key: #Hide #defaultString: 'Hide' #catalogID: #BGOK) #select: #hideData ) #(#RadioButtonSpec #layout: #(#Point 24 176 ) #model: #dataLocation #label: #(#{Kernel.UserMessage} #key: #Adjacent #defaultString: 'Adjacent' #catalogID: #BGOK) #select: #dataAdjacent ) #(#RadioButtonSpec #layout: #(#Point 24 152 ) #model: #dataLocation #label: #(#{Kernel.UserMessage} #key: #Below #defaultString: 'Below' #catalogID: #BGOK) #select: #dataBelow ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 14 0.5 257 0 ) #model: #lines #label: #(#{Kernel.UserMessage} #key: #Hide #defaultString: 'Hide' #catalogID: #BGOK) #select: #hide ) #(#RadioButtonSpec #layout: #(#LayoutOrigin 14 0.5 232 0 ) #model: #lines #label: #(#{Kernel.UserMessage} #key: #Show #defaultString: 'Show' #catalogID: #BGOK) #select: #show ) #(#InputFieldSpec #layout: #(#LayoutFrame 12 0 31 0 -10 1 56 0 ) #model: #explode #menu: #fieldMenu #type: #string ) #(#InputFieldSpec #layout: #(#LayoutFrame 12 0 83 0 -10 1 108 0 ) #model: #dLabel #menu: #fieldMenu #type: #string ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 32 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #LabelsToExplode #defaultString: 'Labels to Explode:' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#AlignmentOrigin 10 0 83 0 0 1 ) #label: #(#{Kernel.UserMessage} #key: #DoughnutLabel #defaultString: 'Doughnut Label:' #catalogID: #BGOK) ) #(#RadioButtonSpec #layout: #(#Point 18 232 ) #model: #shape #label: #(#{Kernel.UserMessage} #key: #Circle #defaultString: 'Circle' #catalogID: #BGOK) #select: #circle ) #(#RadioButtonSpec #layout: #(#Point 18 257 ) #model: #shape #label: #(#{Kernel.UserMessage} #key: #Ellipse #defaultString: 'Ellipse' #catalogID: #BGOK) #select: #ellipse ) ) ) )
</methods> <methods> Tools.ChartColorTool class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: #(#{Kernel.UserMessage} #key: #ColorTool #defaultString: 'Color Tool' #catalogID: #BGOK) #min: #(#Point 389 236 ) #max: #(#Point 389 236 ) #bounds: #(#Rectangle 442 207 831 443 ) ) #component: #(#SpecCollection #collection: #( #(#CompositeSpecCollection #collection: #() #compositeSpec: #(#CompositeSpec #layout: #(#Rectangle 316 151 382 175 ) #name: #theActualColor #colors: #(#LookPreferences ) ) ) #(#RegionSpec #layout: #(#Rectangle 316 151 382 175 ) #lineWidth: 1 ) #(#SliderSpec #layout: #(#Rectangle 8 9 29 175 ) #model: #sliderModel #orientation: #vertical ) #(#LabelSpec #layout: #(#Point 319 131 ) #label: #(#{Kernel.UserMessage} #key: #V #defaultString: 'V' #catalogID: #BGOK) ) #(#LabelSpec #layout: #(#Point 366 131 ) #name: #hueLabel #label: #(#{Kernel.UserMessage} #key: #H #defaultString: 'H' #catalogID: #BGOK) ) #(#CompositeSpecCollection #collection: #() #compositeSpec: #(#CompositeSpec #layout: #(#Rectangle 34 8 304 176 ) #name: #colorSpace #flags: 8 #isOpaque: true ) ) #(#SliderSpec #layout: #(#Rectangle 362 9 384 133 ) #name: #hue #model: #hue #orientation: #vertical #start: 0.999 #stop: 0 #step: -0.001 ) #(#SliderSpec #layout: #(#Rectangle 314 9 336 133 ) #model: #brightness #orientation: #vertical #start: 1.0 #stop: 0.0 #step: -0.001 ) #(#SliderSpec #layout: #(#Rectangle 338 9 360 133 ) #name: #saturation #model: #saturation #orientation: #vertical #start: 1.0 #stop: 0.0 #step: -0.001 ) #(#LabelSpec #layout: #(#Point 343 131 ) #name: #saturationLabel #label: #(#{Kernel.UserMessage} #key: #S #defaultString: 'S' #catalogID: #BGOK) ) #(#ActionButtonSpec #layout: #(#Rectangle 314 202 385 232 ) #name: #cancelButton #model: #cancel #tabable: false #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #BGOK) #defaultable: true ) #(#ActionButtonSpec #layout: #(#Rectangle 235 202 309 232 ) #name: #applyButton #model: #accept #tabable: false #label: #(#{Kernel.UserMessage} #key: #OK #defaultString: 'OK' #catalogID: #BGOK) #isDefault: true ) #(#RegionSpec #layout: #(#Rectangle 12 208 81 232 ) #name: #foregroundChip #isOpaque: true #lineWidth: 1 ) #(#ActionButtonSpec #layout: #(#Rectangle 12 208 81 232 ) #name: #foregroundButton #flags: 0 #model: #changeFGColor #tabable: false #label: ' ' ) #(#LabelSpec #layout: #(#AlignmentOrigin 47 0 208 0 0.5 1 ) #name: #foregroundChipLabel #label: #(#{Kernel.UserMessage} #key: #Foreground #defaultString: 'Foreground' #catalogID: #BGOK) #style: #small ) #(#RegionSpec #layout: #(#Rectangle 116 207 185 231 ) #name: #backgroundChip #isOpaque: true #lineWidth: 1 ) #(#ActionButtonSpec #layout: #(#Rectangle 116 208 185 231 ) #name: #backgroundButton #flags: 0 #model: #changeBGColor #tabable: false #label: ' ' ) #(#LabelSpec #layout: #(#AlignmentOrigin 151 0 208 0 0.5 1 ) #name: #backgroundChipLabel #label: #(#{Kernel.UserMessage} #key: #Background #defaultString: 'Background' #catalogID: #BGOK) #style: #small ) ) ) )
</methods> <methods> Tools.ChartColorTool class <category>resources</category>
colorMenu "UIMenuEditor new openOnClass: self andSelector: #colorMenu" <resource: #menu> ^#(#PopUpMenu #(#(#{Kernel.UserMessage} #key: #NamedColors #defaultString: 'Named Colors' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #PolicyColors #defaultString: 'Policy Colors' #catalogID: #BGOK) ) #() #(#(#PopUpMenu #(#(#{Kernel.UserMessage} #key: #black #defaultString: 'black' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #blue #defaultString: 'blue' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #brown #defaultString: 'brown' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #chartreuse #defaultString: 'chartreuse' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #cyan #defaultString: 'cyan' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #darkCyan #defaultString: 'darkCyan' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #darkGray #defaultString: 'darkGray' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #darkGreen #defaultString: 'darkGreen' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #darkMagenta #defaultString: 'darkMagenta' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #darkRed #defaultString: 'darkRed' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #olive #defaultString: 'olive' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #gray #defaultString: 'gray' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #green #defaultString: 'green' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #lightYellow #defaultString: 'lightYellow' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #lightGray #defaultString: 'lightGray' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #magenta #defaultString: 'magenta' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #navy #defaultString: 'navy' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #orange #defaultString: 'orange' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #orchid #defaultString: 'orchid' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #paleGreen #defaultString: 'paleGreen' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #pink #defaultString: 'pink' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #purple #defaultString: 'purple' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #red #defaultString: 'red' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #royalBlue #defaultString: 'royalBlue' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #salmon #defaultString: 'salmon' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #lightCyan #defaultString: 'lightCyan' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #springGreen #defaultString: 'springGreen' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #veryDarkGray #defaultString: 'veryDarkGray' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #veryLightGray #defaultString: 'veryLightGray' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #white #defaultString: 'white' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #yellow #defaultString: 'yellow' #catalogID: #BGOK) ) #() #(#black #blue #brown #chartreuse #cyan #darkCyan #darkGray #darkGreen #darkMagenta #darkRed #olive #gray #green #lightYellow #lightGray #magenta #navy #orange #orchid #paleGreen #pink #purple #red #royalBlue #salmon #lightCyan #springGreen #veryDarkGray #veryLightGray #white #yellow ) ) #(#PopUpMenu #(#(#{Kernel.UserMessage} #key: #Foreground #defaultString: 'Foreground' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #Background #defaultString: 'Background' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #SelnFrgnd #defaultString: 'Sel''n Frgnd' #catalogID: #BGOK) #(#{Kernel.UserMessage} #key: #SelnBkgnd #defaultString: 'Sel''n Bkgnd' #catalogID: #BGOK) ) #() #(#foregroundColor #backgroundColor #selectionForegroundColor #selectionBackgroundColor ) ) ) ) decodeAsLiteralArray
</methods> <methods> Tools.ToolbarIconLibrary class <category>resources</category>
chartWidget20x20 "Tools.UIMaskEditor new openOnClass: self andSelector: #chartWidget20x20" <resource: #image> ^CachedImage on: (Image extent: 20@20 depth: 4 bitsPerPixel: 4 palette: (Graphics.MappedPalette withColors: ((Core.Array new: 9) at: 1 put: Graphics.ColorValue black; at: 2 put: (Graphics.ColorValue scaledRed: 0 scaledGreen: 0 scaledBlue: 4111); at: 3 put: (Graphics.ColorValue scaledRed: 0 scaledGreen: 4111 scaledBlue: 0); at: 4 put: Graphics.ColorValue red; at: 5 put: Graphics.ColorValue white; at: 6 put: (Graphics.ColorValue scaledRed: 7644 scaledGreen: 0 scaledBlue: 0); at: 7 put: (Graphics.ColorValue scaledRed: 0 scaledGreen: 0 scaledBlue: 3822); at: 8 put: (Graphics.ColorValue scaledRed: 0 scaledGreen: 3822 scaledBlue: 0); at: 9 put: Graphics.ColorValue blue; yourself)) usingBits: (ByteArray fromPackedString: '@@@@@@@@@@@@@@@@ADQDQDQDQDQDP@@@ADQDQDQFQ4UHP@@@ADQDQDQ@@@@@P@@@ADQDQDQDQDQDP@@@@DY&QDQDQDQDP@@@ADY&QDQDQDQDP@@@ADY&QDQDQD"HP@@@ADY&QDQDQD"HP@@@@DY&Q7]DQD"HP@@@ADY&Q7]DQD"HP@@@ADY&Q7]DQD"HP@@@ADY&Q7]DQD"HP@@@@DY&Q7]EUT"HP@@@ADY&Q7]EUT"HP@@@ADY&Q7]EUT"HP@@@ADY&Q7]EUT"HP@@@ADY&Q7]EUT"HP@@@ADDQP"ICL4"HP@@@@@@@@@@@@@@@@@@@'))
chartWidget20x20mask "Tools.UIMaskEditor new openOnClass: self andSelector: #chartWidget20x20mask" <resource: #image> ^CachedImage on: (Image extent: 20@20 depth: 1 bitsPerPixel: 1 palette: CoveragePalette monoMaskPalette usingBits: #[255 255 240 0 128 0 16 0 128 21 80 0 128 31 208 0 128 0 16 0 220 0 16 0 156 0 16 0 156 1 208 0 156 1 208 0 221 193 208 0 157 193 208 0 157 193 208 0 157 193 208 0 221 221 208 0 157 221 208 0 157 221 208 0 157 221 208 0 157 221 208 0 157 221 208 0 255 255 240 0])
</methods> <initialize> UI.BG_ChartView </initialize> <initialize> UI.BG_ChartElement </initialize> <initialize> UI.BG_Label </initialize> <initialize> UI.ChartViewSpec </initialize> <initialize> UI.BG_DataPointMarker </initialize> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>VisualComponent</name> <environment>Graphics</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>Graphics-Visual Objects</category> <attributes> <package>Graphics-Visual Objects</package> </attributes> </class> <class> <name>Label</name> <environment>UI</environment> <super>Graphics.VisualComponent</super> <private>false</private> none text attributes width offset needsScan fontPolicy <imports></imports> <category>UIBasics-Support</category> <attributes> <package>UIBasics-Support</package> </attributes> </class> <class> <name>LookPreferences</name> <environment>UI</environment> <super>UI.ColorPreferencesCollection</super> <private>false</private> none foregroundColor backgroundColor selectionForegroundColor selectionBackgroundColor borderColor hiliteColor shadowColor <imports></imports> <category>Interface-Support</category> <attributes> <package>Interface-Support</package> </attributes> </class> <class> <name>VisualPart</name> <environment>Graphics</environment> <super>Graphics.VisualComponent</super> <private>false</private> none container eventHandlers properties <imports></imports> <category>Graphics-Visual Objects</category> <attributes> <package>Graphics-Visual Objects</package> </attributes> </class> <class> <name>DependentComposite</name> <environment>Graphics</environment> <super>Graphics.CompositePart</super> <private>false</private> none model <imports></imports> <category>Graphics-Visual Objects</category> <attributes> <package>Graphics-Visual Objects</package> </attributes> </class> <class> <name>SubSpec</name> <environment>UI</environment> <super>UI.UISpecification</super> <private>false</private> none <imports></imports> <category>UIBuilder-Specifications</category> <attributes> <package>UIBuilder-Specifications</package> </attributes> </class> <class> <name>ApplicationModel</name> <environment>UI</environment> <super>UI.Model</super> <private>false</private> none builder uiSession eventHandlers savedWindowInformation <imports></imports> <category>UIBuilder-Framework</category> <attributes> <package>UIBuilder-Framework</package> </attributes> </class> <class> <name>SpecModel</name> <environment>Tools</environment> <super>UI.ApplicationModel</super> <private>false</private> none specChannel <imports></imports> <category>UIBuilder-Specifications</category> <attributes> <package>UIPainter</package> </attributes> </class> <class> <name>GeometricWrapper</name> <environment>Graphics</environment> <super>Graphics.Wrapper</super> <private>false</private> none <imports></imports> <category>Graphics-Geometrical Objects</category> <attributes> <package>Graphics-Geometrical Objects</package> </attributes> </class> <class> <name>SimpleDialog</name> <environment>UI</environment> <super>UI.ApplicationModel</super> <private>false</private> none close accept cancel preBuildBlock postBuildBlock postOpenBlock escapeIsCancel parentView <imports></imports> <category>Interface-Dialogs</category> <attributes> <package>Interface-Dialogs</package> </attributes> </class> <class> <name>WidgetSpec</name> <environment>UI</environment> <super>UI.NamedSpec</super> <private>false</private> none model callbacksSpec tabable helpText helpField <imports></imports> <category>UIBuilder-Specifications</category> <attributes> <package>UIBuilder-Specifications</package> </attributes> </class> <class> <name>ArrayedCollection</name> <environment>Core</environment> <super>Core.SequenceableCollection</super> <private>false</private> none <imports></imports> <category>Collections-Abstract</category> <attributes> <package>Collections-Abstract</package> </attributes> </class>