In Files

Parent

CustomLineCap

Custom line caps allow you to define your own custom shapes for line start and end caps - for example to create your own shape of arrowhead. To use a CustomLineCap, you must first assign it to a Pen object using the setCustomStartCap and setCustomEndCap methods.

The shape is defined using a GraphicsPath object. When defining the a GraphicsPath for a custom line cap, the co-ordinate system works a little differently that usual...

Public Class Methods

new(nil, GraphicsPath, offset) → CustomLineCap click to toggle source
new(GraphicsPath, nil, offset) → CustomLineCap

Create a new CustomLineCap. The given GraphicsPath defines the shape of the new cap according to the class notes above. Offset (a Float number) shifts the line cap by the given number of grid units in the direction that the line is pointing.

If the GraphicsPath argument is preceded by 'nil', the cap will be drawn as an unfilled outline using the same pen as the line which it is capping. If the GraphicsPath is followed by 'nil', the cap will be drawn as a solid filled shape.

See pg.189 of the User Guide for some helpful diagrams showing how a custom line cap relates to the line which it is capping.

# File GUI_Classes.rb, line 368
def self.new
  #DUMMY
end

Public Instance Methods

setStrokeCaps(String, String) click to toggle source

If the custom line cap is to be drawn as an unfilled shape, calling setStrokeCaps defines how any drawn strokes are capped. The first argument defines how the start of a stroke is capped, and the second argument defines how the end of strokes are capped. Each takes a short string descriptor from the following list...

"square", "round", "triangle"

See pg.190 of the User Guide for a more detailed description.

# File GUI_Classes.rb, line 397
def setStrokeCaps
  #DUMMY
end
setStokeJoin(String) click to toggle source

If the custom line cap is to be drawn as an unfilled shape, calling setStrokeJoin defines how straight lines are joined for the cap's shape. The single argument is a short String descriptor from the following list...

"bevel", "round", "mitreclipped"

See pg.190 of the User Guide for a more detailed description.

# File GUI_Classes.rb, line 412
def setStrokeJoin
  #DUMMY
end
setWidthScale(Float) click to toggle source

This method is used to scale a line cap. A setting of 1.0 will draw the cap at the size at which it was originally defined (NB - this is relative to the thickness of the Pen that it is capping). A value of 0.5 would halve the size; 2.0 would double the size; and so on...

# File GUI_Classes.rb, line 380
def setWidthScale
  #DUMMY
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.