Skip to content

Commit

Permalink
Merge branch 'propPath'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andesha committed Jul 16, 2019
2 parents a80917e + 5236276 commit fe631fa
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 61 deletions.
15 changes: 13 additions & 2 deletions eegplugin_vised_marks.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@
end

version = get_version('vised_marks', 'vised_marks1.0.0');

% Removing the code found in the following if-statement will alow for
% multiple copies of PropertyGrid to be in the Matlab path. This has been
% known to cause issues inside of EEGLAB. If there are any compatability
% issues please contact us.
if exist('PropertyGrid')
warning('PropertyGrid was already found. Overwriting path with VisedMarks version.');
rmStr = which('PropertyGrid');
rmpath(fileparts(rmStr));
end

%% start up
addpath(genpath(fileparts(which('eegplugin_vised_marks.m'))));

Expand All @@ -89,8 +100,8 @@
finalcmdVE=[try_strings.no_check VisEd_cmd catch_strings.add_to_hist];

%CONFIG
uimenu(filemenu, 'Label', 'Vised configuration','separator','on', ...
'callback','vised_config=pop_edit_vised_config;');
uimenu(filemenu, 'Label', 'Vised configuration','separator','off', ...
'callback','vised_config=pop_edit_vised_config;','position',length(filemenu.Children) - 2);

% add "Visual edit" submenu to the "Edit" menu.
%--------------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions vised/external/PropertyGrid/Contents.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@
% javaStringArray - Converts a MatLab cell array of strings into a java.lang.String array.
%
% String utility functions

% pg_strjoin - Concatenates a cell array of strings.
% pg_strsplit - Splits a string into a cell array of strings.

% strjoin - Concatenates a cell array of strings.
% strsplit - Splits a string into a cell array of strings.
% var2str - Textual representation of any MatLab value.
% strsetmatch - Indicator of which elements of a universal set are in a particular set.
%
Expand Down
4 changes: 1 addition & 3 deletions vised/external/PropertyGrid/JidePropertyGridField.m
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ function delete(self)

function self = FindByName(selfarray, name)
% Finds the property field with the given name in an array.

self = selfarray.FindByNameRecurse(pg_strsplit(name, '.'));

self = selfarray.FindByNameRecurse(strsplit(name, '.'));
end

function properties = GetProperties(selfarray)
Expand Down
6 changes: 2 additions & 4 deletions vised/external/PropertyGrid/PropertyGrid.m
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,9 @@ function OnKeyPressed(obj, event)
name = PropertyGrid.GetSelectedProperty(obj);
self = PropertyGrid.FindPropertyGrid(obj, 'Table');
if ~isempty(name) && ~isempty(self.BoundItem) % help

nameparts = pg_strsplit(name, '.');
nameparts = strsplit(name, '.');
if numel(nameparts) > 1
helpobject = nestedfetch(self.BoundItem, pg_strjoin('.', nameparts(1:end-1)));

helpobject = nestedfetch(self.BoundItem, strjoin('.', nameparts(1:end-1)));
else
helpobject = self.BoundItem;
end
Expand Down
5 changes: 1 addition & 4 deletions vised/external/PropertyGrid/PropertyGridField.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@

function self = set.Category(self, category)
validateattributes(category, {'char'}, {'nonempty','row'});
if strcmp(category(1),' ')
category = category(2:1:end);
end;
self.Category = category;
end

Expand Down Expand Up @@ -170,7 +167,7 @@ function WireHierarchy(selfarray, descendants)
% hu.bme.aut.www (not a direct child)
names = getclassfield(selfarray, 'Name');
if iscell(filterprefix)
prefix = [pg_strjoin('.', filterprefix) '.'];
prefix = [strjoin('.', filterprefix) '.'];
else
prefix = [filterprefix '.'];
end
Expand Down
10 changes: 3 additions & 7 deletions vised/external/PropertyGrid/PropertyType.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
end
if ~isempty(self.Domain)
if iscellstr(self.Domain)

s = [s ' ' pg_strjoin(',', self.Domain)];

s = [s ' ' strjoin(',', self.Domain)];
elseif isnumeric(self.Domain)
s = [s ' ' mat2str(self.Domain)];
end
Expand Down Expand Up @@ -286,9 +284,7 @@
javavalue = mat2str(value);
end
case 'cellstr'

javavalue = java.lang.String(pg_strjoin(sprintf('\n'), value));

javavalue = java.lang.String(strjoin(sprintf('\n'), value));
case 'logical'
if ~isempty(self.Domain)
javavalue = javaStringArray(self.Domain(value)); % value is an indicator vector
Expand Down Expand Up @@ -344,7 +340,7 @@
return;
end
case 'cellstr'
value = pg_strsplit(javavalue);
value = strsplit(javavalue);
case 'logical'
if ~isempty(self.Domain)
value = strsetmatch(cell(javavalue), self.Domain);
Expand Down
8 changes: 2 additions & 6 deletions vised/external/PropertyGrid/helpdialog.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ function helpdialog(obj)
% help text
rgb = get(fig, 'Color');
text = cellfun(@(line) helpdialog_html(line), text, 'UniformOutput', false);

html = ['<html>' pg_strjoin(sprintf('\n'), text) '</html>'];

html = ['<html>' strjoin(sprintf('\n'), text) '</html>'];
jtext = javax.swing.JLabel(html);
jcolor = java.awt.Color(rgb(1), rgb(2), rgb(3));
jtext.setBackground(jcolor);
Expand Down Expand Up @@ -112,6 +110,4 @@ function helpdialog_resize(fig, event) %#ok<INUSD>
line = [ line(1:ix-1) regexprep(line(ix:end), '(\w[\d\w]+)', '<a href="matlab:helpdialog $1">$1</a>') ];
end


html = ['<p>' leadingspace line '</p>'];

html = ['<p>' leadingspace line '</p>'];
32 changes: 16 additions & 16 deletions vised/external/PropertyGrid/license.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Copyright (c) 2010, Levente Hunyadi
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
7 changes: 2 additions & 5 deletions vised/external/PropertyGrid/nestedassign.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
% Copyright 2010 Levente Hunyadi
function obj = nestedassign(obj, name, value)
if ~iscell(name)

nameparts = pg_strsplit(name, '.');

nameparts = strsplit(name, '.');
else
nameparts = name;
end
Expand All @@ -50,5 +48,4 @@
else
obj.(name{1}) = value;
end

end
end
4 changes: 1 addition & 3 deletions vised/external/PropertyGrid/nestedfetch.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
% Copyright 2010 Levente Hunyadi
function value = nestedfetch(obj, name)
if ~iscell(name)

nameparts = pg_strsplit(name, '.');

nameparts = strsplit(name, '.');
else
nameparts = name;
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
% strings:
% a cell array of strings to join
%
% See also: pg_strsplit, cell2mat
% See also: strsplit, cell2mat

% Copyright 2008-2009 Levente Hunyadi
function string = pg_strjoin(adjoiner, strings)
function string = strjoin(adjoiner, strings)

validateattributes(adjoiner, {'char'}, {'vector'});
validateattributes(strings, {'cell'}, {'vector'});
assert(iscellstr(strings), ...
'pg_strjoin:ArgumentTypeMismatch', ...
'strjoin:ArgumentTypeMismatch', ...
'The elements to join should be stored in a cell vector of strings (character arrays).');
if isempty(strings)
string = '';
Expand All @@ -33,4 +33,4 @@
end

% concatenate substrings preserving spaces
string = cell2mat(concat);
string = cell2mat(concat);
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
% adjoiner:
% string separating each neighboring element
%
% See also: pg_strjoin
% See also: strjoin

% Copyright 2008-2009 Levente Hunyadi
function strings = pg_strsplit(string, adjoiner)
function strings = strsplit(string, adjoiner)

if nargin < 2
adjoiner = sprintf('\n');
Expand All @@ -20,4 +20,4 @@
ix = [0 ix numel(string)+1]; % place implicit adjoiners before and after string
for k = 2 : numel(ix)
strings{k-1} = string(ix(k-1)+1:ix(k)-1);
end
end

0 comments on commit fe631fa

Please sign in to comment.