<commit_before>;; Copyright (c) <NAME>. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.

(ns conexp.contrib.gui.base
  "Provides basic definitions for the standard conexp-clj GUI."
  (:import [java.awt event.WindowEvent])
  (:use [conexp.base :only (defnk, illegal-state, unsupported-operation)]
        [conexp.main :only (conexp-version)]
        conexp.contrib.gui.util
        conexp.contrib.gui.plugins
        [conexp.contrib.gui.plugins.base :only (load-plugin)]
        [conexp.contrib.gui.editors.contexts :only (context-editor)]
        [conexp.contrib.gui.editors.lattices :only (lattice-editor)]
        [conexp.contrib.gui.editors.code :only (code-editor)])
  (:use seesaw.core))

;;; Helper Functions

(defn- show-license []
  (show!
   (dialog :content (scrollable
                     (editor-pane :content-type "text/html"
                                  :text (slurp
                                         (get-resource "res/epl-v10.html"))
                                  :editable? false
                                  :caret-position 0))
           :size [800 :by 500]
           :resizable? false)))

(defn- show-about []
  (show!
   (dialog :content (vertical-panel :items [(label :text (str "conexp-clj " (conexp-version))
                                                   :size [300 :by 16]
                                                   :halign :center)
                                            (label :text "Graphical User Interface"
                                                   :size [300 :by 16]
                                                   :halign :center)
                                            (label :text "ⓒ 2013 <NAME>"
                                                   :size [300 :by 30]
                                                   :halign :center
                                                   :valign :bottom)])
           :resizable? false
           :size [300 :by 121])))

;;; Conexp Main Frame

(defnk conexp-main-frame
  "Returns main frame for conexp standard gui."
  [:default-close-operation :dispose]
  (let [tabbed-pane  (tabbed-panel)
        main-frame   (frame :title "conexp-clj"
                            :size [640 :by 480]
                            :on-close default-close-operation)]

    ;; set content
    (config! main-frame :content tabbed-pane)

    ;; Main menu first
    (add-menus main-frame
               [(menu :text "Main"
                      :items
                      [(menu-item :text "Save window configuration to file"
                                  :enabled? false)
                       (menu-item :text "Load window configuration from file"<commit_msg>Update copyright note of GUI<commit_after>;; Copyright (c) <NAME>. All rights reserved.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the terms of this license.
;; You must not remove this notice, or any other, from this software.

(ns conexp.contrib.gui.base
  "Provides basic definitions for the standard conexp-clj GUI."
  (:import [java.awt event.WindowEvent])
  (:use [conexp.base :only (defnk, illegal-state, unsupported-operation)]
        [conexp.main :only (conexp-version)]
        conexp.contrib.gui.util
        conexp.contrib.gui.plugins
        [conexp.contrib.gui.plugins.base :only (load-plugin)]
        [conexp.contrib.gui.editors.contexts :only (context-editor)]
        [conexp.contrib.gui.editors.lattices :only (lattice-editor)]
        [conexp.contrib.gui.editors.code :only (code-editor)])
  (:use seesaw.core))

;;; Helper Functions

(defn- show-license []
  (show!
   (dialog :content (scrollable
                     (editor-pane :content-type "text/html"
                                  :text (slurp
                                         (get-resource "res/epl-v10.html"))
                                  :editable? false
                                  :caret-position 0))
           :size [800 :by 500]
           :resizable? false)))

(defn- show-about []
  (show!
   (dialog :content (vertical-panel :items [(label :text (str "conexp-clj " (conexp-version))
                                                   :size [300 :by 16]
                                                   :halign :center)
                                            (label :text "Graphical User Interface"
                                                   :size [300 :by 16]
                                                   :halign :center)
                                            (label :text "ⓒ 2013, 2014 <NAME>"
                                                   :size [300 :by 30]
                                                   :halign :center
                                                   :valign :bottom)])
           :resizable? false
           :size [300 :by 121])))

;;; Conexp Main Frame

(defnk conexp-main-frame
  "Returns main frame for conexp standard gui."
  [:default-close-operation :dispose]
  (let [tabbed-pane  (tabbed-panel)
        main-frame   (frame :title "conexp-clj"
                            :size [640 :by 480]
                            :on-close default-close-operation)]

    ;; set content
    (config! main-frame :content tabbed-pane)

    ;; Main menu first
    (add-menus main-frame
               [(menu :text "Main"
                      :items
                      [(menu-item :text "Save window configuration to file"
                                  :enabled? false)
                       (menu-item :text "Load window configuration from file"
{'fraction_non_alphanumeric': 0.10148232611174458, 'fraction_numerical': 0.01498615409675843, 'mean_word_length': 1.400312744331509, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 48, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4099685', 'n_tokens_mistral': 1650, 'n_tokens_neox': 1520, 'n_words': 480}