Module: TECSCDE

Includes:
View::Constants
Defined in:
lib/tecscde/view.rb,
lib/tecscde.rb,
lib/tecscde/logger.rb,
lib/tecscde/command.rb,
lib/tecscde/control.rb,
lib/tecscde/palette.rb,
lib/tecscde/version.rb,
lib/tecscde/tm_object.rb,
lib/tecscde/tecs_model.rb,
lib/tecscde/preferences.rb,
lib/tecscde/view/canvas.rb,
lib/tecscde/attr_tree_view.rb,
lib/tecscde/view/constants.rb,
lib/tecscde/view/main_view.rb,
lib/tecscde/tecs_model/hbar.rb,
lib/tecscde/tecs_model/vbar.rb,
lib/tecscde/view/cairo_matrix.rb,
lib/tecscde/cell_plugin_dialog.rb,
lib/tecscde/celltype_tree_view.rb,
lib/tecscde/change_set_control.rb,
lib/tecscde/tecs_model/tm_cell.rb,
lib/tecscde/tecs_model/tm_join.rb,
lib/tecscde/tecs_model/tm_port.rb,
lib/tecscde/highlighted_objects.rb,
lib/tecscde/main_view_and_model.rb,
lib/tecscde/tecs_model/tm_c_port.rb,
lib/tecscde/tecs_model/tm_e_port.rb,
lib/tecscde/tecs_model/tm_region.rb,
lib/tecscde/tecs_model/tm_join_bar.rb,
lib/tecscde/tecs_model/tm_port_array.rb,
lib/tecscde/tecs_model/tm_uneditable.rb,
lib/tecscde/tecs_model/tm_c_port_array.rb,
lib/tecscde/tecs_model/tm_e_port_array.rb,
lib/tecscde/change_set_control/change_set.rb,
lib/tecscde/change_set_control/change_set_manager.rb

Overview

TECSCDE - TECS Component Diagram Editor

Copyright © 2014-2019 by TOPPERS Project

The above copyright holders grant permission gratis to use,
duplicate, modify, or redistribute (hereafter called use) this
software (including the one made by modifying this software),
provided that the following four conditions (1) through (4) are
satisfied.

(1) When this software is used in the form of source code, the above
    copyright notice, this use conditions, and the disclaimer shown
    below must be retained in the source code without modification.

(2) When this software is redistributed in the forms usable for the
    development of other software, such as in library form, the above
    copyright notice, this use conditions, and the disclaimer shown
    below must be shown without modification in the document provided
    with the redistributed software, such as the user manual.

(3) When this software is redistributed in the forms unusable for the
    development of other software, such as the case when the software
    is embedded in a piece of equipment, either of the following two
    conditions must be satisfied:

  (a) The above copyright notice, this use conditions, and the
      disclaimer shown below must be shown without modification in
      the document provided with the redistributed software, such as
      the user manual.

  (b) How the software is to be redistributed must be reported to the
      TOPPERS Project according to the procedure described
      separately.

(4) The above copyright holders and the TOPPERS Project are exempt
    from responsibility for any type of damage directly or indirectly
    caused from the use of this software and are indemnified by any
    users or end users of this software from any and all causes of
    action whatsoever.

THIS SOFTWARE IS PROVIDED "AS IS." THE ABOVE COPYRIGHT HOLDERS AND
THE TOPPERS PROJECT DISCLAIM ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, ITS APPLICABILITY TO A PARTICULAR
PURPOSE. IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS AND THE
TOPPERS PROJECT BE LIABLE FOR ANY TYPE OF DAMAGE DIRECTLY OR
INDIRECTLY CAUSED FROM THE USE OF THIS SOFTWARE.

Defined Under Namespace

Modules: ChangeSetControl, View Classes: AttrTreeView, CellPluginDialog, CelltypeTreeView, Command, Control, Error, HighlightedObjects, Logger, MainViewAndModel, Palette, Preferences, TECSModel, TmObject

Constant Summary collapse

UNSELECTED_STR =

Structure of Palette Window

+-- @window -----------------------------+
|+-- @box ------------------------------+|
||+- mode (@mode_frame) ---------------+||
|||+-@mode_vbox-----------------------+|||
||||  Pointer  (@pointer_button)      ||||
|||+----------------------------------+|||
||||  New Cell (@new_button)          ||||
|||+----------------------------------+|||
||+- celltypes (@celltype_frame)-------+||
|||+- ClltypeTreeView&ScrolledWindow--+|||
|||| name    | region                 ||||
|||+---------+------------------------+|||
||||         |                        ||||
||||         |                        ||||
|||+---------+------------------------+|||
||+- cell properties (@mode_celltype) -+||
|||+- AttrTreeView&ScrolledWindow-----+|||
|||| name    | type    | value        ||||
|||+---------+---------+--------------+|||
||||         |         |              ||||
||||         |         |              ||||
|||+---------+---------+--------------+|||
|+--------------------------------------+|
+----------------------------------------+
"(unselected)"
VERSION =
"0.6.0"
FORMAT_VERSION =
"0.5.0"

Constants included from View::Constants

View::Constants::ALIGN_CENTER, View::Constants::ALIGN_LEFT, View::Constants::ALIGN_RIGHT, View::Constants::CELLTYPE_NAME, View::Constants::CELL_NAME, View::Constants::CELL_NAME_L, View::Constants::CHAR_A, View::Constants::CHAR_Z, View::Constants::CHAR__, View::Constants::CURSOR_JOINING, View::Constants::CURSOR_JOIN_OK, View::Constants::CURSOR_NORMAL, View::Constants::CURSOR_PORT, View::Constants::Color_editable, View::Constants::Color_editable_cell, View::Constants::Color_highlight, View::Constants::Color_incomplete, View::Constants::Color_uneditable, View::Constants::Color_unjoin, View::Constants::DPI, View::Constants::GAP_ACTIVE, View::Constants::GAP_PORT, View::Constants::PAPER_COMMENT, View::Constants::PAPER_MARGIN, View::Constants::PORT_NAME, View::Constants::SCALE, View::Constants::SCALE_HEIGHT, View::Constants::SCALE_VAL_INI, View::Constants::SCALE_VAL_MAX, View::Constants::SCALE_VAL_MIN, View::Constants::SIGNATURE_NAME, View::Constants::TEXT_HORIZONTAL, View::Constants::TEXT_VERTICAL, View::Constants::TRIANGLE_HEIGHT, View::Constants::TRIANGLE_LEN

Class Method Summary collapse

Class Method Details

.confirm?(message, parent = nil) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/tecscde.rb', line 30

def self.confirm?(message, parent = nil)
  dialog = Gtk::Dialog.new(
    "Confirm",
    parent,
    Gtk::Dialog::Flags::MODAL | Gtk::Dialog::Flags::DESTROY_WITH_PARENT,
    [Gtk::Stock::OK, Gtk::ResponseType::OK],
    [Gtk::Stock::CANCEL, Gtk::ResponseType::CANCEL]
  )
  dialog.vbox.add(Gtk::Label.new(message))
  dialog.show_all
  response = dialog.run
  dialog.destroy
  response == Gtk::ResponseType::OK
end

.loggerObject



70
71
72
# File 'lib/tecscde/logger.rb', line 70

def logger
  @logger ||= TECSCDE::Logger.new
end

.main(tecsgen) ⇒ Object



55
56
57
58
# File 'lib/tecscde.rb', line 55

def self.main(tecsgen)
  MainViewAndModel.new(tecsgen)
  Gtk.main
end

.message_box(message, ok_yn_okcan) ⇒ Object

TECSCDE.message_box

Function to open a dialog box displaying the message provided.

ok_yn_okcan

RETURN



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/tecscde.rb', line 13

def self.message_box(message, ok_yn_okcan)
  dialog = Gtk::Dialog.new("Message",
                           nil,
                           nil,
                           [Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK])

  dialog.vbox.add(Gtk::Label.new(message))
  dialog.show_all

  res = nil
  dialog.run do |response|
    res = response
  end
  dialog.destroy
  res
end

.quit(model, parent = nil) ⇒ Object



45
46
47
48
49
50
51
52
53
# File 'lib/tecscde.rb', line 45

def self.quit(model, parent = nil)
  if model.modified?
    if TECSCDE.confirm?("変更を保存せずに終了しますか?")
      Gtk.main_quit
    end
  else
    Gtk.main_quit
  end
end

.testObject



60
61
62
# File 'lib/tecscde.rb', line 60

def self.test
  MainViewAndModel.new.test_main
end