draw

package
v0.0.0-...-9a2d19c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2018 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package draw contains drawing procedures which defines grapical representations of several entities including gui elements, such as menu and also petri net components - places, transitions, arcs

Index

Constants

View Source
const (
	DefaultStyle = Style(iota)
	HighlightedStyle
	FadedStyle
)
View Source
const (
	PLACE_RADIUS      = 24.0
	TRANSITION_WIDTH  = 18.0
	TRANSITION_HEIGHT = 72.0
)

Variables

View Source
var (
	WHITE   = color.RGBA{255, 255, 255, 255} // #ffffff
	WHITISH = color.RGBA{239, 239, 239, 255} // #efefef

	LIGHT_GRAY = color.RGBA{204, 204, 204, 255} // #cccccc
	GRAY       = color.RGBA{128, 128, 128, 255} // #808080
	DARK_GRAY  = color.RGBA{51, 51, 51, 255}    // #333333

	BLACKISH = color.RGBA{16, 16, 16, 255} // #101010
	BLACK    = color.RGBA{0, 0, 0, 255}    // #000000
)

Functions

func Arc

func Arc(ctx draw2d.GraphicContext, style Style, path []Pos, dir Direction, weight int)

func Clean

func Clean(ctx draw2d.GraphicContext, width, height int)

func ExportBorder

func ExportBorder(ctx draw2d.GraphicContext)

func InhibitorArc

func InhibitorArc(ctx draw2d.GraphicContext, style Style, path []Pos)

func Init

func Init(ctx draw2d.GraphicContext, width, height int)
func Menu(ctx draw2d.GraphicContext, sWidth, sHeight int, itemsNames []string, activeIndex int, tooltip string, disabled []bool, pos Gravity) ([]float64, float64, float64)

func Place

func Place(ctx draw2d.GraphicContext, style Style, pos Pos, n int, description string)

func Splash

func Splash(ctx draw2d.GraphicContext, title string)

func Transition

func Transition(ctx draw2d.GraphicContext, style Style, pos Pos, attrs, description string)

Types

type Direction

type Direction bool
const (
	In  Direction = true
	Out Direction = false
)

type Drawer

type Drawer interface {
	DrawPlace(pos Pos, n int, description string)
	DrawTransition(pos Pos, attrs, description string)
	DrawInArc(path []Pos, weight int)
	DrawOutArc(path []Pos, weight int)
	DrawInhibitorArc(path []Pos)
	SetStyle(style Style)
}

type Gravity

type Gravity bool
const (
	Up   Gravity = true
	Down Gravity = false
)

type Pos

type Pos struct {
	X float64
	Y float64
}

func (Pos) Equal

func (pos Pos) Equal(p Pos) bool

type Style

type Style int

func (Style) Background

func (s Style) Background() color.RGBA

func (Style) Color

func (s Style) Color() color.RGBA

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL